fix(naked-ui): correct selection semantics and press state - #84
Merged
Conversation
Contributor
LCOV of commit
|
Contributor
LCOV of commit
|
leoafarias
marked this pull request as ready for review
August 4, 2026 17:33
This was referenced Aug 4, 2026
4 tasks
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.
Description
Corrects two shared interaction contracts used by Remix components.
NakedToggleOptionnow marks options as members of a mutually exclusive group, matching Flutter's segmented-control semantics while preserving explicit child nodes, controlled selection, and disabled behavior.NakedTextFieldnow keeps its public press callbacks andWidgetState.pressedsynchronized when multi-tap selection, drag selection, scrolling, or force press takes ownership. Disabled tap, drag, directional-navigation, and force-press paths are gated before Flutter's selection behavior runs.Adversarial review exposed one lifecycle edge case in that implementation: Flutter's tap tracker also resets when its recognizer is disposed. Forwarding that reset synchronously could invoke a consumer callback that rebuilt an ancestor while the widget tree was locked. The reset now clears internal pressed state immediately, defers consumer callbacks until rebuilding is safe, skips them after unmount, and invalidates stale deferred resets when a newer press transition wins.
This is a behavioral and accessibility correction with no public API or rendered design change, so screenshots are not applicable.
Validation
setState() or markNeedsBuild() called when widget tree was lockedon the prior implementation and passes with the lifecycle-safe reset.flutter test test/src/naked_textfield_press_state_test.dart test/src/naked_textfield_test.dart test/semantics/naked_textfield_semantics_test.dart test/src/naked_toggle_test.dart test/semantics/naked_toggle_semantics_test.dart— 109 passed.flutter test— 678 passed, 3 intentionally skipped external integration tests.flutter analyze --fatal-infos— no issues.dart format --output=none --set-exit-if-changed ...— 0 changed.git diff --check— clean.Related Issues
No linked issue was supplied.
Checklist
Breaking Change
Does this PR require users of the package to manually update their code?