Skip to content

Commit b5dbd1c

Browse files
committed
AppKitBackend: Fix TextField horizontal scrolling (now smooth)
1 parent 53689ae commit b5dbd1c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/AppKitBackend/AppKitBackend.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,10 @@ public final class AppKitBackend: AppBackend {
615615
}
616616

617617
public func createTextField() -> Widget {
618-
let field = NSObservableTextField()
618+
// Using the `(string:)` initializer ensures that the TextField scrolls
619+
// smoothly on horizontal overflow instead of jumping a full width at a
620+
// time.
621+
let field = NSObservableTextField(string: "")
619622
return field
620623
}
621624

0 commit comments

Comments
 (0)