From f179f0a54f409d0709990eea0499fcf21db85227 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 21 Sep 2022 22:42:32 -0400 Subject: [PATCH] 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 --- chrome/content/zotero-platform/mac/itembox.css | 6 ++++++ chrome/content/zotero/bindings/itembox.xml | 3 ++- chrome/skin/default/zotero/zotero.css | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero-platform/mac/itembox.css b/chrome/content/zotero-platform/mac/itembox.css index 25e1762426..879cd5f70e 100644 --- a/chrome/content/zotero-platform/mac/itembox.css +++ b/chrome/content/zotero-platform/mac/itembox.css @@ -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; diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 8edead9307..e181d95334 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -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; diff --git a/chrome/skin/default/zotero/zotero.css b/chrome/skin/default/zotero/zotero.css index 571798dfcd..c42815cc3f 100644 --- a/chrome/skin/default/zotero/zotero.css +++ b/chrome/skin/default/zotero/zotero.css @@ -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 */