Skip to content

Commit

Permalink
Fix #3885: Chips separator works on mobile (#3911)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jan 3, 2023
1 parent 09e204e commit f567375
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/chips/Chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const Chips = React.memo(
return;
}

switch (event.code) {
switch (event.key) {
case 'Backspace':
if (inputRef.current.value.length === 0 && values.length > 0) {
removeItem(event, values.length - 1);
Expand All @@ -104,7 +104,7 @@ export const Chips = React.memo(

if (isMaxedOut()) {
event.preventDefault();
} else if (props.separator === ',' && event.code === 'Comma') {
} else if (props.separator === ',' && event.key === ',') {
addItem(event, inputValue, true);
}

Expand Down

0 comments on commit f567375

Please sign in to comment.