Skip to content

Commit

Permalink
fix(Combobox): fix issue with numpad keys acting as home, end (carbon…
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored Oct 18, 2023
1 parent 20c087b commit 86781db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86781db

Please sign in to comment.