mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -68,6 +68,7 @@ export default function TabBar({
|
||||
)}
|
||||
key={id}
|
||||
onKeyDown={handleKeyDown}
|
||||
onMouseDown={() => selectTab(id)}
|
||||
title={title || label}
|
||||
>
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user