Select tab when the mouse is pressed

Selecting the tab when the mouse is pressed rather than only when it is
released makes tab switching feel faster and also matches how the Chrome dev
tools behave.

The previous tab selection handler which listens for the radio button's
selection has been kept for the benefit of interaction methods which
don't trigger the mousedown handler.
This commit is contained in:
Robert Knight
2019-04-18 08:16:52 +01:00
parent 0d932d770b
commit c2865dbab9
+1
View File
@@ -68,6 +68,7 @@ export default function TabBar({
)}
key={id}
onKeyDown={handleKeyDown}
onMouseDown={() => selectTab(id)}
title={title || label}
>
<input