Skip to content

Commit

Permalink
fix(expandable section): V6 fix uncaught exception (#10697)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlabaj authored Jul 8, 2024
1 parent cfa3395 commit 887d788
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ class ExpandableSection extends React.Component<ExpandableSectionProps, Expandab
};

resize = () => {
const { offsetWidth } = this.expandableContentRef.current;
if (this.state.previousWidth !== offsetWidth) {
this.setState({ previousWidth: offsetWidth });
this.checkToggleVisibility();
if (this.expandableContentRef) {
const { offsetWidth } = this.expandableContentRef.current;
if (this.state.previousWidth !== offsetWidth) {
this.setState({ previousWidth: offsetWidth });
this.checkToggleVisibility();
}
}
};
handleResize = debounce(this.resize, 250);
Expand Down

0 comments on commit 887d788

Please sign in to comment.