1
0
mirror of synced 2025-02-11 17:49:24 +03:00

clicking down arrow or enter in multisearch combo now expands, closes #5565

This commit is contained in:
Igor Vaynberg 2019-07-17 08:13:24 -07:00
parent 44a88a9c56
commit 32b8818c1b
3 changed files with 24 additions and 15 deletions

View File

@ -346,23 +346,32 @@ export class MultiSelect extends AbstractSelect<Props, State> {
};
public onSearchKeyDown = (event: KeyboardEvent) => {
if (this.handleResultNavigationKeyDown(event)) {
return;
}
const { open } = this.state;
if (open && this.hasSearchResults) {
if (open) {
if (this.handleResultNavigationKeyDown(event)) {
return;
}
if (this.hasSearchResults) {
switch (event.key) {
case Key.Enter:
this.selectActiveResult();
event.preventDefault();
break;
case Key.Escape:
if (open) {
this.close();
}
event.preventDefault();
break;
}
}
} else {
switch (event.key) {
case Key.ArrowDown:
case Key.Down:
case Key.Enter:
this.selectActiveResult();
event.preventDefault();
break;
case Key.Escape:
if (open) {
this.close();
}
event.preventDefault();
this.search('', this.props.values, { open: true });
break;
}
}

2
dist/select25.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long