-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added support for Alt+Down Arrow
and Alt+Up Arrow
in ComboBox
#14892
Changes from all commits
f204450
9a3379a
081a8c1
941ec98
1528348
6a1f39c
0ee2a07
19ff172
11e0107
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -593,6 +593,19 @@ const ComboBox = forwardRef( | |
event.target.value.length | ||
); | ||
} | ||
|
||
if (event.altKey && event.key == 'ArrowDown') { | ||
event.preventDownshiftDefault = true; | ||
if (!isOpen) { | ||
toggleMenu(); | ||
} | ||
} | ||
if (event.altKey && event.key == 'ArrowUp') { | ||
event.preventDownshiftDefault = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this prevent exactly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It prevents the default behavior of |
||
if (isOpen) { | ||
toggleMenu(); | ||
} | ||
} | ||
}, | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem to be working ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no definition for
keys.Alt
inpackages/react/src/internal/keyboard/keys.js
. Could you add it and retry usingmatch()
again?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had tried this after adding definition for Alt key
However, if I put any one condition it works as expected but both simultaneously are not working :(