Skip to content

Fix the text editor's frame and page zoom in iOS Safari - #3

Merged
Inchill merged 2 commits into
mainfrom
fix/text-editor-outline
Oct 22, 2026
Merged

Inchill merged 2 commits into
mainfrom
fix/text-editor-outline

Conversation

@Inchill

@Inchill Inchill commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Two problems with the text editor in iOS Safari: its dashed frame lost its left edge while typing, and editing text on a zoomed-out board zoomed the whole page in.

Frame

  • .rwb-text-editor drew the frame with outline: 1px dashed and outline-offset: 4px. It now uses border: 1px dashed with padding: 4px and margin: -5px (box-sizing: content-box), which gives the same frame without relying on how Safari paints outlines on a textarea.
  • The text area's content box stays exactly where it was, so typed text still lines up with the rendered text.

Page zoom

iOS Safari zooms the page in when a text field under 16px gets focus, and keeps the zoom afterwards. The editor's font is the text size times the board zoom, so on a zoomed-out board it was often under 16px (20px text at 40% is 8px).

  • When the on-screen size is under 16px, the editor is laid out at 16px (width and height divided by the same factor) and scaled down with transform: scale(k) around the text's top-left corner. Border, padding and margin are divided by k so the frame still looks 1px with 4px of padding.
  • At 16px and above nothing changes.
  • New component test: at 100% the editor is unscaled; after zooming out it is 16px with a scale(…) transform. It fails without the change.

Both fixes are added to the 1.1.1 changelog entry, since 1.1.1 has not been published yet.

Checks

  • format:check, lint, typecheck, test and the site build pass.
  • At 40% zoom in Chromium the editor computes to 16px with scale(0.6), and the text being edited lines up exactly with the same text once committed.
  • In Chromium at phone width, the old and new styles put the text at the same position (120, 185) with the same width, and the frames look identical. Safari's own behavior could not be reproduced here and needs a check on an iPhone.

Generated by Claude Code

The dashed frame around text being edited was an outline with an offset, and
iOS Safari dropped its left edge while typing. It is now a 1px border around
4px of padding, pulled out by a matching negative margin, so it looks the same
and the text stays where it is drawn.
iOS Safari zooms the page in when a text field under 16px gets focus and keeps
the zoom afterwards. On a zoomed-out board the text editor's font is often
smaller than that. The editor is now laid out at 16px or more and scaled down
to the on-screen size around the text's top-left corner, with its frame scaled
to match, so the text still lines up with the drawn text.
@Inchill Inchill changed the title Keep the text editor's frame whole in iOS Safari Fix the text editor's frame and page zoom in iOS Safari Oct 22, 2026
@Inchill
Inchill merged commit c32dd2f into main Oct 22, 2026
1 check passed
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.

1 participant