mirror of
https://github.com/apache/superset.git
synced 2026-04-17 07:05:04 +00:00
fix auto select override pre-selected value bug (#2745)
auto select should only apply to cases where select control doesn't have pre-selected value prop. If select control has pre-selected value (passed in from value prop), auto select first avaliable options should not apply.
This commit is contained in:
@@ -41,7 +41,7 @@ class AsyncSelect extends React.PureComponent {
|
||||
$.get(this.props.dataEndpoint, (data) => {
|
||||
this.setState({ options: mutator ? mutator(data) : data, isLoading: false });
|
||||
|
||||
if (this.props.autoSelect && this.state.options.length) {
|
||||
if (!this.props.value && this.props.autoSelect && this.state.options.length) {
|
||||
this.onChange(this.state.options[0]);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user