From 86781db1627f819ff560db64dba0389bb99b889b Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Wed, 18 Oct 2023 05:27:21 -0400 Subject: [PATCH] fix(Combobox): fix issue with numpad keys acting as home, end (#14924) --- packages/react/src/components/ComboBox/ComboBox.tsx | 4 ++-- .../react/src/components/MultiSelect/FilterableMultiSelect.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/components/ComboBox/ComboBox.tsx b/packages/react/src/components/ComboBox/ComboBox.tsx index 400dbf38d5ac..a53c2abea5ff 100644 --- a/packages/react/src/components/ComboBox/ComboBox.tsx +++ b/packages/react/src/components/ComboBox/ComboBox.tsx @@ -590,11 +590,11 @@ const ComboBox = forwardRef( } } - if (match(event, keys.Home)) { + if (match(event, keys.Home) && event.code !== 'Numpad7') { event.target.setSelectionRange(0, 0); } - if (match(event, keys.End)) { + if (match(event, keys.End) && event.code !== 'Numpad1') { event.target.setSelectionRange( event.target.value.length, event.target.value.length diff --git a/packages/react/src/components/MultiSelect/FilterableMultiSelect.js b/packages/react/src/components/MultiSelect/FilterableMultiSelect.js index 07f235035fa1..bda6384794e6 100644 --- a/packages/react/src/components/MultiSelect/FilterableMultiSelect.js +++ b/packages/react/src/components/MultiSelect/FilterableMultiSelect.js @@ -329,11 +329,11 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect( handleOnMenuChange(false); } - if (match(event, keys.Home)) { + if (match(event, keys.Home) && event.code !== 'Numpad7') { event.target.setSelectionRange(0, 0); } - if (match(event, keys.End)) { + if (match(event, keys.End) && event.code !== 'Numpad1') { event.target.setSelectionRange( event.target.value.length, event.target.value.length