Repository navigation
fix(ui): phone form controls render at 16px so iOS doesn't zoom on focus (#4526) - #4527
jordanallenlewis wants to merge 4 commits into
Conversation
iOS Safari zooms the page in when a focused field's text is under 16px and leaves it zoomed after blur. Trinity's filters, search boxes and composers use text-xs / text-sm, so on a phone most text fields zoomed the layout sideways (4-5 such fields on Operations > Executions, Events and the Tasks tab). Below sm on a touch screen, text inputs, selects and textareas render at 16px. The desktop keeps its dense sizes. Tests: e2e on a 390px touch screen finds no text control under 16px on Operations, Events and Tasks; on the desktop the dense controls stay.
|
Thanks for this one. A global rule is the right placement (a
Smaller, same push if you can:
Setting |
…om spec in CI (Abilityai#4526) - Key the 16px form-control rule on (pointer: coarse) alone so an iPhone in landscape (667-932px wide) doesn't zoom on focus either. - Give the chat composer's ghost-text overlay the same 16px under the same media query, so the completion stays on the typed text. - Give a text-xs textarea text-sm's 20px line-height at 16px text. - Tag the agent-free cases of e2e/phone-input-zoom.spec.js @smoke so CI runs them, and add landscape.
|
Pushed
Checked in Chromium emulation (isMobile, hasTouch, coarse pointer) against I didn't merge |
Description
On a touch screen (
(pointer: coarse), portrait or landscape), text inputs, selects and textareas render at 16px, so iOS Safari doesn't zoom the page when one is focused. Checkboxes, radios and sliders are left alone. A[class]copy of the select and textarea selectors lifts the rule over a singletext-*utility. The desktop and a narrow desktop window (fine pointer) keep the dense sizes. The width bound is dropped on purpose: an iPhone in landscape is 667-932px wide and zooms the same way. A tablet with a coarse pointer gets 16px fields too.The chat composer's ghost-text overlay (
ChatInput.vue, used byChatPanelandPublicChat) gets the same 16px under the same media query so the completion stays on the typed text. Atext-xstextarea getstext-sm's 20px line-height at 16px text.The other common fix,
maximum-scale=1in the viewport tag, also blocks pinch zoom on Android, which fails WCAG 1.4.4, so this doesn't use it.Related Issue
Fixes #4526
Journey Impact
Journey Impact: none: font size of form fields on touch screens below 640px
Type of Change
Testing
e2e/phone-input-zoom.spec.js: on a touch screen in portrait (390x844) and landscape (844x390), Operations → Executions, Events and the Tasks tab have text fields and none is under 16px; on the desktop the dense fields stay under 16px. The agent-free cases are tagged@smokeso the CI job runs them.vite devwith a mocked API, not on a real device: the ghost overlay and the textarea both compute 16px / 24px at 390x844 and 844x390, and atext-xstextarea computes 16px / 20px. Mutation: withstyle.cssrestored fromdev, all six phone cases fail. A real-device spot check (iPhone, portrait and landscape) would be welcome.check:tokensandbuildpass.