Skip to content

Commit

Permalink
Merge branch '1.8' into 1
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed May 11, 2021
2 parents 1ba4255 + 4793b9f commit 15258b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions client/src/components/TreeDropdownField/TreeDropdownField.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,7 @@ class TreeDropdownField extends Component {

// Hack! Temporary fix until we can do a proper upgrade of react-select to >= 2.0.
// eslint-disable-next-line func-names
Select.prototype.componentDidUpdate = function (oldProps, oldState) {
const nextProps = this.props;

Select.prototype.componentWillReceiveProps = function (nextProps) {
function handleRequired(value, multi) {
if (!value) {
return true;
Expand All @@ -717,13 +715,13 @@ Select.prototype.componentDidUpdate = function (oldProps, oldState) {
this.setState({
required: handleRequired(valueArray[0], nextProps.multi)
});
} else if (oldProps.required) {
} else if (this.props.required) {
// Used to be required but it's not any more
this.setState({ required: false });
}
// Array comparison in react-select is broken.
const [current, next] = [oldProps.value, nextProps.value].map(JSON.stringify);
if (oldState.inputValue && current !== next && nextProps.onSelectResetsInput) {
const [current, next] = [this.props.value, nextProps.value].map(JSON.stringify);
if (this.state.inputValue && current !== next && nextProps.onSelectResetsInput) {
this.setState({ inputValue: this.handleInputValueChange('') });
}
};
Expand Down

0 comments on commit 15258b2

Please sign in to comment.