Skip to content
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

Slideover/Modal does not cover the full page if input is focused on Safari (iOS) #1867

Closed
ahoiroman opened this issue Sep 21, 2022 · 7 comments
Assignees

Comments

@ahoiroman
Copy link

ahoiroman commented Sep 21, 2022

What package within Headless UI are you using?

@headlessui/vue

What version of that package are you using?

v1.7.2

What browser are you using?

Safari

Reproduction URL

I used the code from "Wide create project form example" from tailwindui. As it's not free, I will not paste it here.

Describe your issue

If a slideover has an input, the height of the slideover is cropped if this input is focused. This does not happen on Safari on macOS, button Safari on iOS (I used Xcode's simulator to recreate the example I am attaching here).

Bildschirmfoto.2022-09-21.um.21.28.19.mp4

Bildschirmfoto 2022-09-21 um 21 28 51@2x

@ahoiroman
Copy link
Author

ahoiroman commented Sep 21, 2022

Hint: This does not happen if the first focused element is a button or something else (at least when the address bar is not at the bottom).

@RobinMalfait
Copy link
Collaborator

Hey! Thank you for your bug report!
Much appreciated! 🙏

This might be a simulator issue where the keyboard is not shown. While testing it on my real device it does seems to behave as expected. Can you verify that this is issue can be reproduced on a real device?

RPReplay_Final1664134514.mov

Also, I noticed that you can use cmd+k to toggle the keyboard in the simulator, maybe that helps with your issue as well if you want to keep developing against a simulator?

@ahoiroman
Copy link
Author

Unfortunately I can reproduce this on my iPhone 12 Pro Max Ultra or whatever this thingie is called ;-) It's the large one and frustrating enough, the error appears if the URL-input-field is set to the bottom (as yours is too in the screencast).

I will try to create a reusable example on codepen :-)

@RobinMalfait
Copy link
Collaborator

Does it help if you play with the viewport units a bit? Right now we are positioning the slideover, but the Safari browser on iOS behaves a bit oddly when showing/hiding those ares (like the URL bar).

The only problem with those units is that they are new and aren't supported everywhere so depending on the OS and browser version you are running it may or may not be available.

I wonder if using 100dvh for the height of the body for example fixes the issue for you.

More info on those: https://www.bram.us/2021/07/08/the-large-small-and-dynamic-viewports/
Or if you have some time, this is a very interesting video to watch: https://www.youtube.com/watch?v=xl9R8aTOW_I

@zacksmash
Copy link

Having some of the same issues. You can see in this video that the entire bottom icon bar moves up with it, like the body is being cut off, since that element is positioned `fixed.

Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2022-10-10.at.16.18.04.mp4

@RobinMalfait RobinMalfait self-assigned this Dec 15, 2022
@RobinMalfait
Copy link
Collaborator

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed by #2100, and will be available in the next release.

You can already try it using:

  • npm install @headlessui/react@insiders.
  • npm install @headlessui/vue@insiders.

@zacksmash
Copy link

@RobinMalfait Looks great! Thanks for the update. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants