Skip to content

Commit

Permalink
fix: MultiSelect escape behaviour when in an overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandercar-vt committed Jan 29, 2025
1 parent 5d092cd commit 8623dda
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/select/src/components/multi-select/multiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ export class MultiSelect<T> extends AbstractPureComponent<MultiSelectProps<T>, M
// input element. It must be done explicitly.
if (e.key === "Escape") {
this.input?.blur();
// prevent other overlays from closing
e.stopPropagation();
// prevent browser-specific escape key behavior (Safari exits fullscreen)
e.preventDefault();
}
this.setState({ isOpen: false });
} else if (!(e.key === "Backspace" || e.key === "ArrowLeft" || e.key === "ArrowRight")) {
Expand Down

0 comments on commit 8623dda

Please sign in to comment.