Bug
TextField has no horizontal scroll offset. When text exceeds the field width:
- Text overflows past the right boundary (no clipping or clipping without scroll)
- Cursor disappears beyond the visible area
- Arrow keys cannot bring cursor back into view
Reproduce
go run ./examples/gallery/
- Click TextField
- Type a long string until it exceeds field width
- Cursor becomes unreachable, text overflows
Expected
When cursor reaches the right edge, text origin shifts left to keep cursor visible (horizontal scroll offset). Standard behavior in all text fields (HTML input, Flutter TextField, Qt QLineEdit).
Implementation
TextField needs a scrollOffsetX float32 field that adjusts when:
- Cursor moves past right edge → shift text left
- Cursor moves past left edge → shift text right
- Text deleted → adjust offset to remove empty space
DrawText and CursorX must account for scrollOffsetX. ContentRect clips the overflow.
Enterprise reference: Flutter's EditableTextState._showCaretOnScreen() + RenderEditable.showCursor.
Environment
- All backends, all themes
- v0.1.50+
Bug
TextField has no horizontal scroll offset. When text exceeds the field width:
Reproduce
go run ./examples/gallery/Expected
When cursor reaches the right edge, text origin shifts left to keep cursor visible (horizontal scroll offset). Standard behavior in all text fields (HTML input, Flutter TextField, Qt QLineEdit).
Implementation
TextField needs a
scrollOffsetX float32field that adjusts when:DrawText and CursorX must account for scrollOffsetX. ContentRect clips the overflow.
Enterprise reference: Flutter's
EditableTextState._showCaretOnScreen()+RenderEditable.showCursor.Environment