Skip to content

fix: set a fallback value for --root-height to prevent page zoom#96

Open
cxa wants to merge 1 commit into
guilhermerodz:masterfrom
cxa:default-root-size
Open

fix: set a fallback value for --root-height to prevent page zoom#96
cxa wants to merge 1 commit into
guilhermerodz:masterfrom
cxa:default-root-size

Conversation

@cxa

@cxa cxa commented Apr 15, 2025

Copy link
Copy Markdown

As title.

See demo below. This is due to, if input's font size is smaller than 16px, for accessibility reasons, iOS will zoom page to enlarge input. So we give a fallback font size with 16px for --root-height which input will use as its font size if --root-height is not available yet.

Without fix:

Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-04-15.at.14.53.54.mp4

With fix:

Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-04-15.at.14.55.29.mp4

@vercel

vercel Bot commented Apr 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rodz-input-otp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2025 1:34pm

@cxa cxa force-pushed the default-root-size branch from 35a5426 to fc119bc Compare April 15, 2025 13:32
@cxa cxa changed the title fix: set a default value for --root-height to avoid page zoom fix: set a fallback value for --root-height to prevent page zoom Apr 15, 2025
@guilhermerodz

Copy link
Copy Markdown
Owner

@cxa thanks for the PR, however I couldn't identify an issue with the first video. Can you help me?

@cxa

cxa commented Aug 3, 2025

Copy link
Copy Markdown
Author

@guilhermerodz In first video, you can see after navigating back, the page zoomed in (compare with 3s and 8s). This is due to page rendering instantly before --root-height available, and Safari on iOS will zoom in when it meets a text input which font size smaller than 16px.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants