Skip to content

Commit

Permalink
[Create index pattern] Can't create single character index without wi…
Browse files Browse the repository at this point in the history
…ldcard (#90919)
  • Loading branch information
alexwizp committed Feb 11, 2021
1 parent c0a974a commit 7d9b4ed
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,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 });
}
Expand Down

0 comments on commit 7d9b4ed

Please sign in to comment.