Additional tweaks for creator button keyboard access (#2826)

- Open creator type menu on ArrowUp as well
- Fix outline on Windows/Linux
- Don't show focus ring on hover, since we already show a background
This commit is contained in:
Dan Stillman 2022-09-21 22:42:32 -04:00
parent ea09aac616
commit f179f0a54f
3 changed files with 15 additions and 2 deletions

View file

@ -25,6 +25,12 @@ row > label:first-child, .creator-type-label, #more-creators-label
max-height: 7px;
}
.zotero-focusable:focus {
/* At least in Fx60, the color doesn't quite match Monterey's native textbox outline,
but it will have to do for now */
outline: 2px solid -moz-mac-focusring !important;
}
textbox
{
margin: -1px 5px -1px 0;

View file

@ -1752,7 +1752,8 @@
var target = event.target;
var focused = document.commandDispatcher.focusedElement;
if (event.key === 'ArrowDown' && target.classList.contains('creator-type-label')) {
if ((event.key == 'ArrowUp' || event.key === 'ArrowDown')
&& target.classList.contains('creator-type-label')) {
event.preventDefault();
target.click();
return true;

View file

@ -150,8 +150,14 @@ label.zotero-text-link {
-moz-user-focus: normal;
}
/* This isn't quite the right color (at least for Win11), but we can fix in fx102 */
.zotero-focusable:focus {
outline: 1px solid -moz-mac-focusring;
outline: 1px dotted darkgray;
}
/* Don't show focus ring for clicky on hover, since we already show a background */
.zotero-clicky.zotero-focusable:focus:hover {
outline: none;
}
/* Minus and plus buttons with clicky glow effect */