Skip to content

Commit

Permalink
Fix #5425: CascadeSelect fix for StrictMode (#5433)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Nov 29, 2023
1 parent 2152b78 commit bf77846
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/lib/cascadeselect/CascadeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export const CascadeSelect = React.memo(
optionGroupIcon={props.optionGroupIcon}
optionLabel={props.optionLabel}
optionValue={props.optionValue}
parentActive={props.value != null}
level={0}
optionGroupLabel={props.optionGroupLabel}
optionGroupChildren={props.optionGroupChildren}
Expand Down
4 changes: 3 additions & 1 deletion components/lib/cascadeselect/CascadeSelectSub.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ export const CascadeSelectSub = React.memo((props) => {
});

useUpdateEffect(() => {
setActiveOptionState(null);
if (!props.parentActive) {
setActiveOptionState(null);
}
}, [props.parentActive]);

const createSubmenu = (option) => {
Expand Down

0 comments on commit bf77846

Please sign in to comment.