mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
dropdown hot key: Generalize enter behaviour for dropup as well as dropdown.
Also updated comment to more accurately represent that this isn't only for the gear menu.
This commit is contained in:
@@ -397,8 +397,8 @@ function handle_popover_events(event_name) {
|
|||||||
|
|
||||||
// Returns true if we handled it, false if the browser should.
|
// Returns true if we handled it, false if the browser should.
|
||||||
export function process_enter_key(e) {
|
export function process_enter_key(e) {
|
||||||
if ($(".dropdown.open").length && $(e.target).attr("role") === "menuitem") {
|
if ($(".dropdown.open, .dropup.open").length > 0 && $(e.target).attr("role") === "menuitem") {
|
||||||
// on #gear-menu li a[tabindex] elements, force a click and prevent default.
|
// on dropdown menu elements, force a click and prevent default.
|
||||||
// this is because these links do not have an href and so don't force a
|
// this is because these links do not have an href and so don't force a
|
||||||
// default action.
|
// default action.
|
||||||
e.target.click();
|
e.target.click();
|
||||||
|
|||||||
Reference in New Issue
Block a user