Skip to content

Commit

Permalink
Fix #7002: Dropdown improve Android key handling (#7003)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Aug 7, 2024
1 parent 0f10825 commit 0adc845
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/lib/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,16 @@ export const Dropdown = React.memo(
};

const onInputKeyDown = (event) => {
if (props.disabled || DomHandler.isAndroid()) {
if (props.disabled) {
event.preventDefault();

return;
}

const metaKey = event.metaKey || event.ctrlKey;
const code = DomHandler.isAndroid() ? event.key : event.code;

switch (event.code) {
switch (code) {
case 'ArrowDown':
onArrowDownKey(event);
break;
Expand Down Expand Up @@ -509,7 +510,7 @@ export const Dropdown = React.memo(
};

const onBackspaceKey = (event, pressedInInputText = false) => {
if (pressedInInputText) {
if (event && pressedInInputText) {
!overlayVisibleState && show();
}
};
Expand Down

0 comments on commit 0adc845

Please sign in to comment.