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
This commit is contained in:
abaevbog 2024-05-01 23:59:10 -04:00 committed by GitHub
parent 04748ec9a6
commit debcb9944d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {