Fix middle-click selecting tab that is being closed

This commit is contained in:
Martynas Bagdonas 2023-07-11 14:01:17 +03:00
parent 0186e6330a
commit 5928147f26

View file

@ -110,6 +110,10 @@ const TabBar = forwardRef(function (props, ref) {
}
function handleTabMouseDown(event, id) {
// Don't select tab if it'll be closed with middle button click on mouse up
if (event.button === 1) {
return;
}
if (event.button === 2) {
let { screenX, screenY } = event;
// Popup gets immediately closed without this