-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix DropdownMenu
keyboard navigation when entries are filtered empty
#155252
Merged
auto-submit
merged 13 commits into
flutter:master
from
PurplePolyhedron:dropdown_menu_filtered_entries
Oct 2, 2024
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b5a4018
update page_transition_theme
PurplePolyhedron ece136c
Update dropdown_menu.dart
PurplePolyhedron 3ac3d59
Update dropdown_menu_test
PurplePolyhedron db95943
merge master
PurplePolyhedron 408e76a
Merge branch 'flutter:master' into dropdown_menu_filtered_entries
PurplePolyhedron 05b4839
Update dropdown_menu.dart
PurplePolyhedron 66f82e6
Update dropdown_menu_test.dart
PurplePolyhedron 26834cf
fix dropdown_menu_test.dart typo
PurplePolyhedron af74eeb
Update dropdown_menu_test.dart
PurplePolyhedron ac0bb91
Update dropdown_menu_test.dart
PurplePolyhedron 71aaeb6
Merge branch 'flutter:master' into dropdown_menu_filtered_entries
PurplePolyhedron fd2f2d7
Update dropdown_menu_test.dart
PurplePolyhedron 298912a
Update dropdown_menu_test.dart
PurplePolyhedron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keyboard navigation is also supported on mobile (Android for sure, iOS probably).
I tried changing
TargetPlatformVariant.desktop()
toTargetPlatformVariant.all()
and the test still passed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The different is
requestFocusOnTap
default to false on mobile, The widget won't gain focus and won't receive key event. (I think this might be why other keyboard navigation tests usedTargetPlatformVariant.desktop()
)I can see setting
requestFocusOnTap
totrue
being overall the better than settingTargetPlatformVariant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. 🙏
For the moment, it makes sense to do the same as the other existing tests.
We can revisit this on a separate "test only" PR (feel free to ping me if you file one, I like PRs that aim at improving existing tests 🔥 ), setting
requestFocusOnTap
totrue
seems to be a nice option (a comment might be interesting to remind why).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops sorry, I was reading the wrong version. I see now that you applies this change, it is ok to me. Feel free to add a comment if you think it worths it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've changed it back to
TargetPlatformVariant.desktop()
for now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, it appears to be some delays and I didn't see the new message in time, I will try to file a PR about overall
requestFocusOnTap
in keyboard navigation in a few days.