clicking down arrow or enter in multisearch combo now expands, closes #5565
This commit is contained in:
parent
44a88a9c56
commit
32b8818c1b
@ -346,23 +346,32 @@ export class MultiSelect extends AbstractSelect<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public onSearchKeyDown = (event: KeyboardEvent) => {
|
public onSearchKeyDown = (event: KeyboardEvent) => {
|
||||||
if (this.handleResultNavigationKeyDown(event)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { open } = this.state;
|
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) {
|
switch (event.key) {
|
||||||
|
case Key.ArrowDown:
|
||||||
|
case Key.Down:
|
||||||
case Key.Enter:
|
case Key.Enter:
|
||||||
this.selectActiveResult();
|
this.search('', this.props.values, { open: true });
|
||||||
event.preventDefault();
|
|
||||||
break;
|
|
||||||
case Key.Escape:
|
|
||||||
if (open) {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
event.preventDefault();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
dist/select25.js
vendored
2
dist/select25.js
vendored
File diff suppressed because one or more lines are too long
2
dist/select25.js.map
vendored
2
dist/select25.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user