Repository navigation
fix(naked_ui): report a button press on pointer down without a long-press handler - #683
Open
chrishiguto wants to merge 6 commits into
Open
chrishiguto wants to merge 6 commits into
chrishiguto wants to merge 6 commits into
Conversation
chrishiguto
force-pushed
the
fortal-refresh/wb-fix-5-button-press
branch
from
December 2, 2026 19:34
97a1112 to
20b7c05
Compare
…/wb-fix-5-button-press
…/wb-fix-5-button-press
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every
NakedButtonregistered long-press callbacks, with or without anonLongPress. With a long-press recognizer in the gesture arena, the tap recognizer waitskPressTimeout(100ms) before it reports the press, so every Remix and Fortal button showed its pressed look about 120ms after pointer down.Scope
NakedButtonregisters its long-press callbacks only when it is interactive and has anonLongPress.Blast Radius
Every naked_ui consumer of
NakedButton(Remix buttons, icon buttons, number field steppers, select, multi select, menu and popover triggers) changes in three ways when the button has noonLongPress. All three match Flutter'sInkWell, checked by a test that runs the same gestures on both:pressed,onPressChange(true)) is reported on pointer down instead of 100ms later, when no other recognizer competes.onPressedon release. Before, the long-press recognizer won the arena and the hold did nothing.With an
onLongPressnothing changes: the tap still waitskPressTimeoutfor the arena, asInkWell's does.CHANGELOG.md(naked_ui, Unreleased) says the same.naked_ui_docs/references.jsonre-pins the button reference to the changed source; the documented signature is unchanged.Verification
Gesture arena in the widgetbook button story (
debugPrintGestureArenaDiagnostics): with the knob on, the arena holds the button's own TapGestureRecognizer and LongPressGestureRecognizer and nothing else from the widgetbook shell; with it off, the tap is the only member and wins at once.Press to first painted frame in the release widgetbook, semantics off: 122 and 128ms before (knob on), 19 to 28ms now.
Matches InkWelltests: a long hold withoutonLongPress(1 tap, pressed true then false), a long hold with it (the long press, no tap), and dragging off (no tap, pressed true then false) give the same results onInkWellandNakedButton. The old code fails the first and third.Mutation: registering the long-press callbacks again makes the pointer-down test fail.
cd packages/naked_ui && flutter test: 1660 passed;cd packages/remix && flutter testpasses.