Skip to content

Commit

Permalink
[BUG] fix dropdown list fail to update when prop change (#2213)
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Co-authored-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
igorDykhta and heshan0131 committed May 2, 2023
1 parent dafec9b commit 1094e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/src/common/item-selector/dropdown-list.tsx
Expand Up @@ -126,7 +126,7 @@ export default class DropdownList extends Component<DropdownListProps, DropdownL
}

getSnapshotBeforeUpdate(prevProps: DropdownListProps, prevState: DropdownListState) {
if (prevProps.options?.length !== this.props.options?.length) {
if (prevProps.options !== this.props.options) {
// check if user searching, reset state.options at the first time
const options = this._getOptions(0);
this.setState({options});
Expand Down

0 comments on commit 1094e73

Please sign in to comment.