diff --git a/packages/amis/src/renderers/Form/NestedSelect.tsx b/packages/amis/src/renderers/Form/NestedSelect.tsx index aafb5e4c4d5..11932fa1966 100644 --- a/packages/amis/src/renderers/Form/NestedSelect.tsx +++ b/packages/amis/src/renderers/Form/NestedSelect.tsx @@ -196,13 +196,11 @@ export default class NestedSelectControl extends React.Component< @autobind handleOutClick(e: React.MouseEvent) { e.stopPropagation(); - - const {options} = this.props; this.outTargetWidth = this.outTarget.current?.clientWidth; e.defaultPrevented || - this.setState({ - isOpened: true - }); + this.setState(prevState => ({ + isOpened: !prevState.isOpened + })); } @autobind