fix(textarea): give a focused multiline field a way to close the keyboard - #99
fix(textarea): give a focused multiline field a way to close the keyboard#99anilcancakir wants to merge 1 commit into
Conversation
…oard Return inserts a newline in a multiline field, which is the point of the field and also means the keyboard has no key that dismisses it. Reported from an iPhone: Return in the input above moved focus into the description textarea, and from there the keyboard stayed up over a form the user could no longer see, with nothing to press. MSTextarea becomes stateful so it can own the FocusNode a keyboard toolbar has to watch, and wraps itself in wind's WKeyboardActions. A caller's own node is still honoured and still NOT disposed here, which the test asserts, because disposing a node someone else created throws on their next use of it. iOS only, and that is the scope of the problem rather than a convenience: Android's soft keyboard carries a system dismiss and desktop has Escape. It also keeps the toolbar out of every consumer's widget tests, which run as Android by default; an active toolbar schedules a frame per frame, so `pumpAndSettle` on a page holding a focused textarea never settles. A read-only or disabled field opens no keyboard and takes no toolbar. Two dead classes go with it, both found by wind's own unknown-token warning while the tests above ran: `focus:outline-none` on the input and the textarea, and `resize-none` on the textarea. Both are CSS-only concepts with nothing to suppress in Flutter, so they read like they were doing something and were not.
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. The keyboard fix is the right shape and the two dead recipe classes really are dead, but conditioning the tree shape on Critical
Major
Minor
TestsThree new cases cover the toolbar's presence on iOS, its absence when read-only, and external-node ownership. Nothing covers the Checks I ran
Note: my scratch probe is still sitting at |
What
MSTextareabecomes stateful, owns aFocusNodewhen the caller passes none, and wraps itself in wind'sWKeyboardActionsso a focused textarea gets a dismiss button above the keyboard. iOS only. A read-only or disabled field takes no toolbar.focus:outline-nonefrom the input and textarea recipes,resize-nonefrom the textarea recipe.Why
Return inserts a newline in a multiline field, so the keyboard has no key that closes it. Reported from an iPhone: Return in the field above moved focus into the description textarea, and from there the keyboard stayed up over a form the user could no longer see with nothing left to press.
iOS is the scope of the problem, not a convenience: Android's soft keyboard carries a system dismiss and desktop has Escape. It also matters for consumers' test suites, which run as Android by default. An active
WKeyboardActionstoolbar schedules a frame per frame, so apumpAndSettleon any page holding a focused textarea would never settle.The three removed classes are CSS-only concepts with nothing to suppress in Flutter. wind reported each as
unknown className ... was ignoredwhile the new tests ran.Testing