mirror of https://github.com/zulip/zulip.git
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:
parent
7f7845eb78
commit
32f75085cb
|
@ -397,8 +397,8 @@ function handle_popover_events(event_name) {
|
|||
|
||||
// Returns true if we handled it, false if the browser should.
|
||||
export function process_enter_key(e) {
|
||||
if ($(".dropdown.open").length && $(e.target).attr("role") === "menuitem") {
|
||||
// on #gear-menu li a[tabindex] elements, force a click and prevent default.
|
||||
if ($(".dropdown.open, .dropup.open").length > 0 && $(e.target).attr("role") === "menuitem") {
|
||||
// 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
|
||||
// default action.
|
||||
e.target.click();
|
||||
|
|
Loading…
Reference in New Issue