[Infra and Logs UI] Fixes "sticky filter" problem (#40226)

* Submits query bar form when everything has been deleted and also on blur to prevent sticky value problem

* Moved reset to cDU to cover all deleted value cases, not just Backspace
This commit is contained in:
Jason Rhodes 2019-07-03 13:20:59 -04:00 committed by GitHub
parent aef6223219
commit 0049345627
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,6 +65,7 @@ export class AutocompleteField extends React.Component<
onKeyDown={this.handleKeyDown}
onKeyUp={this.handleKeyUp}
onSearch={this.submit}
onBlur={this.submit}
placeholder={placeholder}
value={value}
/>
@ -100,6 +101,10 @@ export class AutocompleteField extends React.Component<
this.updateSuggestions();
}
if (hasNewValue && this.props.value === '') {
this.submit();
}
if (hasNewSuggestions && this.state.isFocused) {
this.showSuggestions();
}