File tree Expand file tree Collapse file tree 4 files changed +4
-2
lines changed Expand file tree Collapse file tree 4 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010### Fixed
1111
1212- Improve ` Portal ` detection for ` Popover ` components ([ #1842 ] ( https://github.com/tailwindlabs/headlessui/pull/1842 ) )
13+ - Fix ` useOutsideClick ` swallowing events inside ShadowDOM ([ #1876 ] ( https://github.com/tailwindlabs/headlessui/pull/1876 ) )
1314
1415## [ 1.7.2] - 2022-09-15
1516
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export function useOutsideClick(
9696 'mousedown' ,
9797 ( event ) => {
9898 if ( enabledRef . current ) {
99- initialClickTarget . current = event . target
99+ initialClickTarget . current = event . composedPath ?. ( ) ?. [ 0 ] || event . target
100100 }
101101 } ,
102102 true
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212- Call ` displayValue ` with a v-model of ` ref(undefined) ` on ` ComboboxInput ` ([ #1865 ] ( https://github.com/tailwindlabs/headlessui/pull/1865 ) )
1313- Improve ` Portal ` detection for ` Popover ` components ([ #1842 ] ( https://github.com/tailwindlabs/headlessui/pull/1842 ) )
1414- Fix crash when ` children ` are ` undefined ` ([ #1885 ] ( https://github.com/tailwindlabs/headlessui/pull/1885 ) )
15+ - Fix ` useOutsideClick ` swallowing events inside ShadowDOM ([ #1876 ] ( https://github.com/tailwindlabs/headlessui/pull/1876 ) )
1516
1617## [ 1.7.2] - 2022-09-15
1718
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export function useOutsideClick(
8282 'mousedown' ,
8383 ( event ) => {
8484 if ( enabled . value ) {
85- initialClickTarget . value = event . target
85+ initialClickTarget . value = event . composedPath ?. ( ) ?. [ 0 ] || event . target
8686 }
8787 } ,
8888 true
You can’t perform that action at this time.
0 commit comments