From 0a1ddf7a8df8e7dc4378883657c6fbcb6c1adcf5 Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Fri, 23 Mar 2018 18:02:57 -0700 Subject: [PATCH] Revert "Prevent props change from affecting local state" This reverts commit f2bb8db12abfb66dbb276afa949437e695b4ada6. --- ui/src/shared/components/MultiSelectDropdown.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/src/shared/components/MultiSelectDropdown.js b/ui/src/shared/components/MultiSelectDropdown.js index 81c7b96ccc..1b9108ae4c 100644 --- a/ui/src/shared/components/MultiSelectDropdown.js +++ b/ui/src/shared/components/MultiSelectDropdown.js @@ -39,6 +39,14 @@ class MultiSelectDropdown extends Component { this.setState({isOpen: false}) } + componentWillReceiveProps(nextProps) { + if (!_.isEqual(this.props.selectedItems, nextProps.selectedItems)) { + return + } + + this.setState({localSelectedItems: nextProps.selectedItems}) + } + toggleMenu = e => { e.stopPropagation() this.setState({isOpen: !this.state.isOpen})