Skip to content

Commit 319bcba

Browse files
Only check for elements in useInertOthers (#3154)
* Only check for elements in useInertOthers * Update changelog * Update packages/@headlessui-react/CHANGELOG.md --------- Co-authored-by: Jonathan Reinink <[email protected]>
1 parent 4acf9e2 commit 319bcba

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- Add `overflow: auto` when using the `anchor` prop ([#3138](https://github.com/tailwindlabs/headlessui/pull/3138))
3030
- Ensure `TransitionRoot` component without props transitions correctly ([#3147](https://github.com/tailwindlabs/headlessui/pull/3147))
3131
- Ensure the `static` and `portal` props work nicely together ([#3152](https://github.com/tailwindlabs/headlessui/pull/3152))
32+
- Only check for elements in `useInertOthers` ([#3154](https://github.com/tailwindlabs/headlessui/pull/3154))
3233

3334
### Changed
3435

packages/@headlessui-react/src/hooks/use-inert-others.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function useInertOthers(
103103
let parent = element.parentElement
104104
while (parent && parent !== ownerDocument.body) {
105105
// Mark all siblings as inert
106-
for (let node of parent.childNodes) {
106+
for (let node of parent.children) {
107107
// If the node contains any of the elements we should not mark it as inert
108108
// because it would make the elements unreachable.
109109
if (allowedElements.some((el) => node.contains(el))) continue

0 commit comments

Comments
 (0)