File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ function handleTab(el, Alpine) {
105
105
'@keydown.up.prevent.stop' ( ) { this . $focus . within ( this . $data . __activeTabs ( ) ) . withWrapAround ( ) . prev ( ) } ,
106
106
'@keydown.left.prevent.stop' ( ) { this . $focus . within ( this . $data . __activeTabs ( ) ) . withWrapAround ( ) . prev ( ) } ,
107
107
':tabindex' ( ) { return this . $tab . isSelected ? 0 : - 1 } ,
108
+ // This is important because we want to only focus the tab when it gets focus
109
+ // OR it finished the click event (mouseup). However, if you perform a `click`,
110
+ // then you will first get the `focus` and then get the `click` event.
111
+ // See https://github.com/tailwindlabs/headlessui/pull/1192
112
+ '@mousedown' ( event ) { event . preventDefault ( ) } ,
108
113
'@focus' ( ) {
109
114
if ( this . $data . __manualActivation ) {
110
115
this . $el . focus ( )
You can’t perform that action at this time.
0 commit comments