fix some buttons not opening on space/Enter (#4243)
E.g., field-version button in itembox merge mode
This commit is contained in:
parent
8f9d5e190e
commit
80b5486991
1 changed files with 4 additions and 4 deletions
|
@ -1056,12 +1056,12 @@ var ZoteroPane = new function()
|
|||
if ([" ", "Enter"].includes(event.key)
|
||||
&& (["button", "toolbarbutton"].includes(tgt.tagName)
|
||||
|| tgt.classList.contains("keyboard-clickable"))) {
|
||||
if (event.target.querySelector("menupopup")) {
|
||||
event.target.click();
|
||||
// Some menus have a history of not opening on programmatic click
|
||||
// If event.target.click above worked, this will be a noop.
|
||||
if (event.target.menupopup) {
|
||||
event.target.open = true;
|
||||
}
|
||||
else {
|
||||
event.target.click();
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue