-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Improve and fix MenuAnchor/MenuItemButton UX for desktop #139395
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
Comments
I started looking and saw flutter/packages/flutter/lib/src/widgets/tap_region.dart Lines 237 to 239 in d7d1572
|
Hi @Fernthedev Screen.Recording.2023-12-04.at.16.17.14.movAlso, will the linked PR solve the 2nd and 3rd problems above? Or are they other issues? |
Hi, thanks for getting back to me. The other issues will not be resolved with the PR. I might look into those if Flutter gives me a direction for resolving them. Specifically, whether if TapRegion should have an option to listen to other mouse buttons, or some other solution. As for the 1st issue, yes you can navigate the menu with the keyboard. However the autofocus attribute is useful in the case where the focus can be requested for a specific element on menu open. For my use case, this is better as it doesn't rely on Flutter's keyboard navigation to figure out how to focus the menu in a listview (Maybe that's just me or a bug in my code, but I don't think the PR can be disregarded yet anyways). I'll try to get some video footage later today. Thanks! |
Thanks for the update. Labeling this point as a feature request. For two remaining issues, please file separate issues for them for better tracking. |
Yes, let's focus (haha!) on the autofocus issue for this one. |
Here's some footage example showcasing the difficulty of navigating to the menu in my desktop app. It also accidentally shows a separate MenuAnchor keyboard bug, which seems harder to resolve since each MenuAnchor is individually controlled. |
MenuAnchor for Material 3 is great for contextual menus but there are some minor issues related to accessibility. This PR aims to close the gap by adding `autofocus` to the menu item button so keyboard navigation is more intuitive. Otherwise, it becomes a mess to navigate through just keyboards. Partially resolves #139395 ## Additional Notes I should mention, I have not written tests for this due to it's trivial nature. I also lack the experience of writing Flutter tests in general, so if someone feels inclined to take over this PR and add it they're welcome to.
MenuAnchor for Material 3 is great for contextual menus but there are some minor issues related to accessibility. This PR aims to close the gap by adding `autofocus` to the menu item button so keyboard navigation is more intuitive. Otherwise, it becomes a mess to navigate through just keyboards. Partially resolves flutter#139395 ## Additional Notes I should mention, I have not written tests for this due to it's trivial nature. I also lack the experience of writing Flutter tests in general, so if someone feels inclined to take over this PR and add it they're welcome to.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Uh oh!
There was an error while loading. Please reload this page.
MenuAnchor for Material 3 is great for contextual menus but there are some minor issues related to accessibility. Specifically, keyboard navigation does not auto-select an element when opening the menu. This causes some UX confusion where the user has to navigate further to access the menu he or she just opened, which in my case is not user friendly.
Setup:
Relevant PR:
MenuItemButton
#139396 MenuItemButton doesn't have anautofocus
attribute, thereby making it harder to navigate with the keyboard.Thanks Flutter Team!
The text was updated successfully, but these errors were encountered: