mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
a9cd868dd8
commit
e08cf61bcc
1 changed files with 6 additions and 1 deletions
|
@ -27,6 +27,7 @@ export class Typeahead extends Component {
|
|||
index: null,
|
||||
value: '',
|
||||
inputIsPristine: true,
|
||||
lastSubmitted: '',
|
||||
};
|
||||
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
|
@ -151,7 +152,10 @@ export class Typeahead extends Component {
|
|||
};
|
||||
|
||||
onSubmit = () => {
|
||||
this.props.onSubmit(this.state.value);
|
||||
if (this.state.lastSubmitted !== this.state.value) {
|
||||
this.props.onSubmit(this.state.value);
|
||||
this.setState({ lastSubmitted: this.state.value });
|
||||
}
|
||||
this.setState({ isSuggestionsVisible: false });
|
||||
};
|
||||
|
||||
|
@ -177,6 +181,7 @@ export class Typeahead extends Component {
|
|||
value={this.state.value}
|
||||
onKeyDown={this.onKeyDown}
|
||||
onKeyUp={this.onKeyUp}
|
||||
onBlur={this.onSubmit}
|
||||
onChange={this.onChangeInputValue}
|
||||
onClick={this.onClickInput}
|
||||
autoComplete="off"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue