From d7c902b18f8e391f061fdb431a31a0f02ad57c3c Mon Sep 17 00:00:00 2001 From: Greg Douglas Date: Thu, 14 Nov 2024 11:35:00 -0500 Subject: [PATCH 1/2] Enable tab focus to move past multiselect input in Firefox --- packages/select/src/components/multi-select/multiSelect.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/select/src/components/multi-select/multiSelect.tsx b/packages/select/src/components/multi-select/multiSelect.tsx index 1d69815585..e247ce7cec 100644 --- a/packages/select/src/components/multi-select/multiSelect.tsx +++ b/packages/select/src/components/multi-select/multiSelect.tsx @@ -419,8 +419,8 @@ export class MultiSelect extends AbstractPureComponent, M if (e.key === "Escape" || e.key === "Tab") { // By default the escape key will not trigger a blur on the // input element. It must be done explicitly. - if (this.input != null) { - this.input.blur(); + if (e.key === "Escape") { + this.input?.blur(); } this.setState({ isOpen: false }); } else if (!(e.key === "Backspace" || e.key === "ArrowLeft" || e.key === "ArrowRight")) { From 6d0ef82449947b91ddc05460c490b694d156e259 Mon Sep 17 00:00:00 2001 From: Greg Douglas Date: Thu, 14 Nov 2024 11:41:58 -0500 Subject: [PATCH 2/2] Enable tab focus to move past suggest input in Firefox --- packages/select/src/components/suggest/suggest.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/select/src/components/suggest/suggest.tsx b/packages/select/src/components/suggest/suggest.tsx index 9cc3b87173..30d8cdf025 100644 --- a/packages/select/src/components/suggest/suggest.tsx +++ b/packages/select/src/components/suggest/suggest.tsx @@ -365,7 +365,11 @@ export class Suggest extends AbstractPureComponent, SuggestSt ) => { return (e: React.KeyboardEvent) => { if (e.key === "Escape" || e.key === "Tab") { - this.inputElement?.blur(); + // By default the escape key will not trigger a blur on the + // input element. It must be done explicitly. + if (e.key === "Escape") { + this.inputElement?.blur(); + } this.setState({ isOpen: false }); } else if ( this.props.openOnKeyDown &&