[Create index pattern] Can't create single character index without wildcard (#90919) (#91081)

This commit is contained in:
Alexey Antonov 2021-02-11 13:24:33 +03:00 committed by GitHub
parent f0fd2ef0bc
commit 55ff85aeb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -182,12 +182,12 @@ export class StepIndexPattern extends Component<StepIndexPatternProps, StepIndex
const { target } = e;
let query = target.value;
if (query.length === 1 && canAppendWildcard(query)) {
if (query.length === 1 && !appendedWildcard && canAppendWildcard(query)) {
query += '*';
this.setState({ appendedWildcard: true });
setTimeout(() => target.setSelectionRange(1, 1));
} else {
if (query === '*' && appendedWildcard) {
if (['', '*'].includes(query) && appendedWildcard) {
query = '';
this.setState({ appendedWildcard: false });
}