-
Notifications
You must be signed in to change notification settings - Fork 55
fix(Toolbar): do not close submenu and navigate next item when press Left/Right arrow keys #1199
Conversation
…Left/Right arrow keys
….com/stardust-ui/react into fix/toolbar-submenu-left-right-arrow
Codecov Report
@@ Coverage Diff @@
## master #1199 +/- ##
==========================================
+ Coverage 83.22% 83.22% +<.01%
==========================================
Files 752 752
Lines 8887 8905 +18
Branches 1192 1262 +70
==========================================
+ Hits 7396 7411 +15
- Misses 1477 1480 +3
Partials 14 14
Continue to review full report at Codecov.
|
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.
Technically, it works.
I don't like it much from architecture POV:
Every time I hit left/right arrow, acc behavior calls doNotNavigateNextParentItem
and it MenuItem
what decides whether to stop propagation of the event based on its submenu state.
If I consider accessibility a separate encapsulated package, this does not work. How should I, as a component developer, know when not to navigate? We can rename the handler to something like doNotNavigateNextParentItemIfYourSubmenuIsOpen
but not sure it makes the API contract much better.
Thank you for the comment. Also, what can be changed is to move check if submenu is opened to behavior
|
If it is possible, that would be better. But even the fact that item behavior knows the implementation details of the components (that item component must do something ( |
fixes #1064
Menu/Toolbar Left and Right arrow should not activate prev/next parent when the focus is in the toolbar submenu. This is expected only in Menu, not in the toolbar