File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
- Nothing yet!
11
11
12
+ ### Fixed
13
+
14
+ - Prevent closing the ` Combobox ` component when clicking inside the scrollbar area ([ #3104 ] ( https://github.com/tailwindlabs/headlessui/pull/3104 ) )
15
+
12
16
## [ 1.7.20] - 2024-04-15
13
17
14
18
### Fixed
Original file line number Diff line number Diff line change @@ -1382,6 +1382,15 @@ export let ComboboxOptions = defineComponent({
1382
1382
} ,
1383
1383
} )
1384
1384
1385
+ /**
1386
+ * Prevent focus from being lost if the user clicks on the scrollbar.
1387
+ * Otherwise the `ComboboxInput` will lose focus and the combobox will
1388
+ * close.
1389
+ */
1390
+ function handleMouseDown ( event : MouseEvent ) {
1391
+ event . preventDefault ( )
1392
+ }
1393
+
1385
1394
return ( ) => {
1386
1395
let slot = { open : api . comboboxState . value === ComboboxStates . Open }
1387
1396
let ourProps = {
@@ -1390,6 +1399,7 @@ export let ComboboxOptions = defineComponent({
1390
1399
ref : api . optionsRef ,
1391
1400
role : 'listbox' ,
1392
1401
'aria-multiselectable' : api . mode . value === ValueMode . Multi ? true : undefined ,
1402
+ onMousedown : handleMouseDown ,
1393
1403
}
1394
1404
let theirProps = omit ( props , [ 'hold' ] )
1395
1405
You can’t perform that action at this time.
0 commit comments