-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Drawer component is very broken on mobile #108
Comments
Yeah it looks like the auto focus on mobile might be an issue. |
I think maybe the right choice is to turn off auto focus with the |
I tried that but it didn't work, I also tried disabling DrawerContent#trapFocus but it made it worse |
Yeah I could be incorrect on how I think autoFocus works but I don't think it really does anything setting it to false. |
oof this one is ugly. I'll need to dig into this one. Focusing the input is the correct behavior, but some things have to be taken into account to compute the right positioning with the keyboard factored in. I'm going to move this where it belongs (vaul-svelte). |
👋
I tested it on several phones and browsers:
Video 1: v1.mp4Video 2: v2.mp4 |
This is also sometimes a problem in iOS Safari. And worse in iOS webview. Completely unusable =/ |
Anyone knows which deps should I downgrade to make it work again? |
I'm working on getting an Android phone so I can properly debug. It's very challenging at the moment without, so if someone who has an android on hand wants to try to implement a fix in the meantime, I'm more than happy to review/merge. |
Thanks hunter. You can always use the Android emulator. See https://dev.to/mochafreddo/setting-up-and-managing-android-emulators-on-macos-with-homebrew-3fg0 And once you have to running, open Chrome in the emulator. Then, in the Mac's Chrome, open |
you can also just download an android emulator, i.e bluestack, but I haven't tried it if it reproduces the bug |
I don't trust emulators very much tbh, I'd rather have the real thing for the full native experience. I've published a pkg-pr-new release, can someone able to reproduce this issue to see if they still experiencing the following: npm i https://pkg.pr.new/vaul-svelte@111 |
@huntabyte the problem continues to occur, only now that I tried it in Google Chrome it looks even worse. Google Chrome Browser Reproduction
Rep111GoogleChrome.mp4DuckDuckGo Browser Reproduction
Rep111DuckDuckGo.mp4Brave Browser Reproduction
Rep111Brave.mp4System Info
Source (from the documentation)
<script lang="ts">
import { buttonVariants } from "$lib/components/ui/button";
import Button from "$lib/components/ui/button/button.svelte";
import * as Drawer from "$lib/components/ui/drawer";
import Input from "$lib/components/ui/input/input.svelte";
import Label from "$lib/components/ui/label/label.svelte";
</script>
<Drawer.Root>
<Drawer.Trigger class={buttonVariants()}>Edit Profile</Drawer.Trigger>
<Drawer.Content>
<Drawer.Header class="text-left">
<Drawer.Title>Edit profile</Drawer.Title>
<Drawer.Description>
Make changes to your profile here. Click save when you're done.
</Drawer.Description>
</Drawer.Header>
<form class="grid items-start gap-4 px-4">
<div class="grid gap-2">
<Label for="email">Email</Label>
<Input type="email" id="email" value="[email protected]" />
</div>
<div class="grid gap-2">
<Label for="username">Username</Label>
<Input id="username" value="@shadcn" />
</div>
<Button type="submit">Save changes</Button>
</form>
<Drawer.Footer class="pt-2">
<Drawer.Close class={buttonVariants({ variant: "outline" })}
>Cancel</Drawer.Close
>
</Drawer.Footer>
</Drawer.Content>
</Drawer.Root> |
Urg, I'll try to get an android device to get to the bottom of this. |
Describe the bug
The Drawer in the @next version breaks inputs on mobile making the keyboard open and close in a very strange way
Reproduction
It happens in the documentation example itself
https://next.shadcn-svelte.com/docs/components/drawer#responsive-dialog
reproduction.mp4
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: