Skip to content

Scroll and clip overflowing single-line text inputs - #90

Merged
ctate merged 2 commits into
mainfrom
fix/input-overflow-scroll
Jul 10, 2026
Merged

ctate merged 2 commits into
mainfrom
fix/input-overflow-scroll

Conversation

@ctate

@ctate ctate commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Bug

Single-line fields advertised clipped overflow but emitted no clip command and ignored any scroll state: long values painted past the field's rounded border and the caret walked out of view while typing continued invisibly.

Fix

  • Single-line fields (input, text field, search field, combobox) clip text, selection rects, composition underlines, and caret to the content rect — the same treatment textareas already had; the clip only engages when content actually overflows, so short-value emission is byte-identical
  • A retained horizontal offset keeps the caret visible with standard semantics: minimal scroll with an edge margin, offset 0 when text fits, clamped back on deletion, recomputed on edits, programmatic set-text, pointer-placed carets, and field resize
  • The offset rides the widget's existing retained value channel (the one textareas use vertically), so no new schema pin and no replay impact

Verification

  • Six new tests: clip emission + shifted origin, ensure-visible + Home, selection/text consistency, short-value invariance, search-field chrome outside the clip, and an end-to-end runtime flow
  • Live keyboard-driven check on a real app: caret visible at the right edge, text clipped at the border, Home scrolls back
  • Zero golden movement; full suite, validate, seven smokes, examples battery, render budgets green

@vercel

vercel Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
native-sdk Ready Ready Preview, Comment Jul 10, 2026 4:14pm

ctate and others added 2 commits July 10, 2026 11:13
- Single-line fields clip their text, selection, and caret to the content rect when the value overflows, matching the textarea treatment
- A retained horizontal offset keeps the caret in view: edits, programmatic set-text, pointer-placed carets, and field resizes all re-run ensure-visible, and the offset rides the existing retained value channel so replay and schema pins are untouched

Co-authored-by: kvnwdev <47703820+kvnwdev@users.noreply.github.com>
@ctate
ctate force-pushed the fix/input-overflow-scroll branch from 568de89 to 914387f Compare July 10, 2026 16:13
@ctate
ctate merged commit 908e3de into main Jul 10, 2026
36 of 37 checks passed
ctate added a commit that referenced this pull request Jul 10, 2026
- Bump @native-sdk/cli and platform packages to 0.4.3.

- Mark the v0.4.3 changelog entry for #89, #90, and #92.

- Remove changelog fragments merged into the release notes.

This branch was successfully deployed

1 active deployment
Preview — 914387f8 Deployed Jul 10, 2026 by vercel[bot]
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