You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS TextField wraps to multiple lines instead of staying single-line (diverges from iOS/GTK4/Android/Windows) #10155
On macOS, an editable TextField wraps its text to multiple lines when the text is wider than the field, instead of staying on one line and scrolling horizontally. macOS is the only platform where TextField is not single-line — the other four backends all make it single-line. A fixed-width field grows tall and misrenders single-line input (URLs, paths, queries).
Environment
Perry 0.5.1531 (local build)
macOS, Darwin 25.6.0, arm64
Native macOS target (perry-ui-macos)
Steps to reproduce
Create a TextField and give it a fixed width narrower than its text.
Set a long single-line value, e.g. assignee = currentUser() AND statusCategory != Done.
The text wraps onto multiple lines instead of staying on one line and scrolling.
Expected
A single-line TextField keeps one line and clips/scrolls horizontally, matching the other platforms and a normal single-line NSTextField. Multiline input already has its own widget, TextArea.
Cross-platform comparison
Every other backend's create() makes TextField single-line; macOS is the outlier.
Platform
Widget
Single-line
iOS (perry-ui-ios)
UITextField
yes — inherently (UITextView is the multiline widget)
GTK4 / Linux (perry-ui-gtk4)
gtk4::Entry
yes — GtkEntry is inherently single-line
Android (perry-ui-android)
EditText
yes — explicit setSingleLine in create()
Windows (perry-ui-windows)
Win32 EDIT
yes — ES_AUTOHSCROLL, no ES_MULTILINE
macOS (perry-ui-macos)
NSTextField
no — wraps
Cause (confirmed in source)
crates/perry-ui-macos/src/widgets/textfield.rscreate() builds the field with NSTextField::textFieldWithString(...) and sets only setEditable(true) and setBezeled(true). It never sets usesSingleLineMode on the field, nor setScrollable(true) / setWraps(false) / a clipping line-break mode on the cell. AppKit's textFieldWithString: returns a cell configured to wrap and grow, so a fixed-width field wraps rather than scrolls.
Perry ships a distinct TextArea widget for multiline, so TextField carrying a wrapping cell is the wrong default, not a limitation. There is also no single-line lever in the perry/ui API (textfieldSet* covers string, focus, border, font, colors — nothing for line mode), so a caller cannot correct it from TypeScript.
Suggested fix
In create(), configure the field for single-line editing to match the other platforms: setUsesSingleLineMode(true), and on the cell setScrollable(true), setWraps(false), and a clipping line-break mode. Multiline already lives in TextArea, so no new option is needed.
Fixed by #10157 (macOS backend), landed via merge train #10163 (main b5a82cfeae). The editable TextField cell is now single-line, scrollable, non-wrapping, and clipped on overflow.
Activity
ci(compile-smoke): skip macOS-only TextField repro on Linux (PerryTS#…
fix(ui-macos): keep editable TextField single-line (#10155)
ci(compile-smoke): skip macOS-only TextField repro on Linux (#10155)
proggeramlug commentedon Sep 13, 2026
Fixed by #10157 (macOS backend), landed via merge train #10163 (main
b5a82cfeae). The editable TextField cell is now single-line, scrollable, non-wrapping, and clipped on overflow.test-parity: allowlist test_issue_10155_textfield_singleline on linux…