From debcb9944d19862565435fe0b8768c95c3dc633f Mon Sep 17 00:00:00 2001 From: abaevbog Date: Wed, 1 May 2024 23:59:10 -0400 Subject: [PATCH] prevent focus from sticking to tab after click (#4078) After clicking on a reader tab, the reader will get focused but the default mousedown event handler can then shift focus onto the actual tab. It looks like the focus gets "lost", and breaks reader keyboard shortcuts so we want to avoid it. Mainly happens on windows. Fixes: #4077 --- chrome/content/zotero/components/tabBar.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chrome/content/zotero/components/tabBar.jsx b/chrome/content/zotero/components/tabBar.jsx index ad0682cedf..b8a00551a7 100644 --- a/chrome/content/zotero/components/tabBar.jsx +++ b/chrome/content/zotero/components/tabBar.jsx @@ -128,6 +128,8 @@ const TabBar = forwardRef(function (props, ref) { } props.onTabSelect(id); event.stopPropagation(); + // Prevents focus from sticking to the actual tab on windows + event.preventDefault(); } function handleTabClick(event, id) {