feat(a11y): add default children behavior to behaviors#1282
feat(a11y): add default children behavior to behaviors#1282silviuaavram merged 16 commits intomasterfrom
Conversation
There was a problem hiding this comment.
I would name it childBehavior as it is only one.
There was a problem hiding this comment.
But, why it should be single? We also have MenuDivider that can be iterated in the same scope...
There was a problem hiding this comment.
I the sense of AccessibilityBehavior type, it can have only one child behavior. For e.g.
MenuBehavior= (props) => {
...
childBehavior: menuItemBehavior
}
There was a problem hiding this comment.
It's not true. menuBehavior has multiple siblings: menuItemBehavior, menuDividerBehavior & submenuBehavior. I had an offline conversation with @miroslavstastny and we agreed on the same thing that was proposed originally:
menuBehavior= (props) => {
// ...
childBehaviors: {
item: menuItemBehavior,
divider: menuDividerBehavior,
}
}It allows to override behaviors for all child items and it's aligned with existing structure on attributes and keyHandlers. Please take one more look on this change.
packages/react/src/lib/accessibility/Behaviors/Toolbar/toolbarBehavior.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #1282 +/- ##
==========================================
- Coverage 72.77% 72.73% -0.05%
==========================================
Files 736 736
Lines 5627 5633 +6
Branches 1624 1630 +6
==========================================
+ Hits 4095 4097 +2
- Misses 1527 1529 +2
- Partials 5 7 +2
Continue to review full report at Codecov.
|
7784136 to
cc53335
Compare
…-ui/react into feat-children-behaviors
| variables, | ||
| styles: styles.divider, | ||
| inSubmenu: submenu, | ||
| accessibility: accessibility.childBehaviors.divider, |
There was a problem hiding this comment.
childBehaviors is optional, check its existence before accessing divider
| active, | ||
| inSubmenu: submenu, | ||
| indicator, | ||
| accessibility: accessibility.childBehaviors.item, |
There was a problem hiding this comment.
childBehaviors is optional, check its existence before accessing item
Fixes #1008
It adds child behaviors by default to Menu related behaviors: