[ListItem] Fix primaryTogglesNestedList behavior when left checkbox is present#4947
[ListItem] Fix primaryTogglesNestedList behavior when left checkbox is present#4947nehalbhanushali wants to merge 1 commit intomui:masterfrom
Conversation
01028e9 to
7cebe3a
Compare
|
@oliviertassinari can you tell me what you think about this? I mean is it worth for the master or will the next branch take care of it? |
|
@nehalbhanushali Could you have a look at #4753 (comment)? I don't think that we are going it the right direction here. |
|
Thanks @oliviertassinari and @rafaelsales . I see what I missed. However, I just wanted to confirm if the checkbox should also be able to toggle the nested list (which I guess, happens with the #4753 fix ). In my opinion it should not. |
|
I think it's fine that the label toggles the checkbox, because solo checkboxes are toggled when you click on the label. I think the main point of that issue was that |
|
@rafaelsales Im not talking about the toggle of the checkbox by the label. I am talking about the toggle of the nested list by clicking the checkbox and not the primary text. Sorry for not being clear. |
|
@nehalbhanushali very very true. Seems like I exchanged a bug by another. |
|
@nehalbhanushali Good point. |
|
Yes, I'll be working on it late today! |
|
would this be a right approach? @oliviertassinari @rafaelsales handleNestedListToggle = (event) => {
event.stopPropagation();
event.stopPropagation();
if (event.target.type === 'checkbox') {
this.setState({open: this.state.open}, () => {
this.props.onNestedListToggle(this);
});
}
else
this.setState({open: !this.state.open}, () => {
this.props.onNestedListToggle(this);
});
};
}; |
|
@nehalbhanushali I think that the best fix is to revert #4988 and to follow #4753 (comment). |
|
@oliviertassinari alright 👍 Although I think the revert would not be required. #4988 resolves the |
When set to true,
primaryTogglesNestedListproperty toggles nested list even when checkbox is present.The fix addresses #4753