-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Safari) inconsistent close behavior on escape keydown #32
Comments
I also checked that I looked into Thanks! |
Oh, one of those lovely "safari-isms". The The likely culprit of this is the fact that Safari doesn't fully respect programmatic focus traps. I'll look into this. Can you confirm if this behavior also exists for the |
Oh I see, thanks for the response! Dialog works perfectly. |
Okay, that's interesting! Seems like I'm missing something in my dialog-wrapping logic in this project then! I will investigate as soon as I have some time! If you're keen to take a look, that's where I'd start is the |
I just spent some time looking into this, it appears the original suffers from the same issue regarding the scrollable content. It does seem to animate, just very rapidly. I'm unsure what is causing this difference at the moment. |
In Chrome, I'm noticing that binding the Do you think this is related to the same issue? Video: https://github.com/huntabyte/vaul-svelte/assets/204153/dbf82d34-e5c1-456a-aca0-a97196410e2a Example, using <script lang="ts">
import { Button } from "$lib/components/ui/button";
import { Menu } from "lucide-svelte";
import { Drawer } from "vaul-svelte"
let drawer0pen = false;
</script>
<Drawer.Root direction="left" bind:open={drawer0pen}>
<Drawer.Portal class="fixed left-0 z-20" style="top: calc(4rem + 1px)">
<Drawer.Content>
<div role="presentation"
class="bg-background"
style="width: 75vw; height: calc(100vh - (4rem + 1px));"
on:click|stopPropagation
>
<!-- Some content -->
</div>
</Drawer.Content>
</Drawer.Portal>
</Drawer.Root>
<div role="presentation"
class="fixed left-0 bg-black/40 dark:bg-white/20 z-10 transition-opacity {drawer0pen ? 'opacity-100' : 'opacity-0'}"
style="width: 100vw; height: calc(100vh - (4rem + 1px)) top: calc(4rem + 1px)"
on:click={() => (drawer0pen = false)}
></div>
<Button variant="ghost" class="md:hidden" on:click={() => (drawer0pen = !drawer0pen)}>
<Menu />
</Button> |
@gdude2002 likely more closely related to an issue #33 will resolve. |
Ah, awesome, thanks for linking that! |
It seems to work well now on the latest release, thanks! |
Describe the bug
There is no exit animation on the escape button click when we change initial focus.
In the attached video, I'm pressing "esc" to close the panel. The closing animation is smooth when I don't click away from the initial input box. However, when I click on something else, e.g. text below, press esc, then there is no closing animation. Tested on macOS Safari.
Screen.Recording.2024-01-20.at.15.32.31.mov
Reproduction
esc
.Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: