-
Notifications
You must be signed in to change notification settings - Fork 55
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1018 +/- ##
==========================================
- Coverage 81.51% 81.26% -0.26%
==========================================
Files 675 673 -2
Lines 8755 8675 -80
Branches 1558 1470 -88
==========================================
- Hits 7137 7050 -87
- Misses 1602 1610 +8
+ Partials 16 15 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1018 +/- ##
==========================================
- Coverage 81.74% 81.67% -0.07%
==========================================
Files 687 687
Lines 8813 8835 +22
Branches 1493 1500 +7
==========================================
+ Hits 7204 7216 +12
- Misses 1594 1604 +10
Partials 15 15
Continue to review full report at Codecov.
|
docs/src/examples/components/Tree/Types/TreeExclusiveExample.shorthand.tsx
Outdated
Show resolved
Hide resolved
public static defaultProps = { | ||
as: 'ul', | ||
accessibility: defaultBehavior, | ||
} | ||
|
||
handleTreeItemOverrides = predefinedProps => ({ | ||
onOpenChanged: (e, treeItemProps) => { |
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.
onOpenChanged: (e, treeItemProps) => { | |
onOpenChanged: (e: React.SyntheticEvent, treeItemProps: TreeItemProps) => { |
This PR contains the chicken-egg problem as I mentioned originally in #479: we have control of I expect from API something like this: const items = [
{
key: '1',
activeIndex: 0, // < ---
title: 'one',
items: [
{
key: '2',
activeIndex: 0, // < ---
title: 'one one',
items: [
{
key: '3',
title: 'one one one',
},
],
},
],
},
{
key: '4',
title: 'two',
items: [
{
key: '5',
title: 'two one',
},
],
},
]
<Tree items={items} activeIndex={1} /> I suggest to move all render() {
return TreeItem.create({ as, items })
} @mnajdova what do you think? |
I agree with your point. I would restrain for suggesting what the changes should be (although I agree with you). The goal of it should be, it should be able to auto control it's state and allow the user to control it. With this changes I don't think we are following this pattern. @priyankar205 please consider the comments from @layershifter - let's make this component follow the stardust principles implemented in all other components. |
@mnajdova @layershifter No other component supports nested subcomponents. I will try to make the suggested changes. |
If I move activeIndex to the TreeItem then how do I control the sibling TreeItems. How do I close the rest when the exclusive flag is there |
Adding the exclusive flag. So that only one subtree can be open at a time