# @solid-primitives/interaction ## 1.1.0 ### Minor Changes - ae9fb08: Add `makeInertOthers` and `createInertOthers`: mark every subtree outside one or more modal layer elements as `aria-hidden` and/or `inert`, with restoration of previous attribute values, ref-counted stacking of layers, an `ignore` list, live-region protection and a `MutationObserver` that also covers nodes added later. Their shared state lives on `globalThis`, so duplicate copies of the package stay consistent. Protected elements inside a target no longer get their siblings hidden, a root equal to a target is handled, live regions added later inside hidden branches are re-evaluated, and `createInertOthers` keeps its stack position when its inputs change (stacking order is opening order: re-enabling a layer puts it on top). `aria-hidden` is deferred on nodes that contain the focused element until focus leaves them, because Chrome ignores it there, and when every target is removed the layer keeps what it holds until it is updated or closed. `ariaHideOutside` and `createHideOutside` are unchanged. `makeInteractOutside` (and `createInteractOutside` / `interactOutside`) no longer leave a touch press armed after it turns into a scroll or drag: the pending touch is dropped on `pointercancel` / `touchcancel`, on movement beyond 10px, on a key press and after a short timeout, and the click must match the stored press. ## 1.0.1 ### Patch Changes - 5f77b81: fix(interaction): keep a trigger excluded when it is in a different shadow root than the watched element - Updated dependencies [b8a7727] - @solid-primitives/utils@7.0.1 ## 1.0.0 ### Major Changes - 9b2475d: Migrate to Solid.js v2.0 (beta.14) ### Minor Changes - b7ef2f3: `createHideOutside`/`ariaHideOutside` gain an opt-in `inert` option — in addition to `aria-hidden`, also sets the `inert` attribute on hidden elements, ref-counted alongside `aria-hidden`. `aria-hidden` alone only affects the accessibility tree; `inert` additionally removes hidden content from focus order, tab order, and pointer/text-selection interaction. Defaults to `false` (no behavior change for existing callers). Also hardened the module-scope ref-counting/observer-stack state (used internally by both the existing `aria-hidden` tracking and the new `inert` tracking) against duplicate installed copies of this package, via the same `globalRegistry` pattern used in `@solid-primitives/scroll`. ### Patch Changes - c485250: fix: `makeInteractOutside`/`createInteractOutside` firing outside-interaction callbacks from an orphaned instance whose watched element was removed from the document before its reactive owner disposed (a common race when a dismissable layer closes and a new one opens in quick succession) - 3f93f4a: `createInteractOutside` / `makeInteractOutside` now resolve interactions across shadow boundaries. An element rendered inside a shadow root no longer treats clicks, taps, or focus on its own content as outside interactions (which dismissed popovers on pointerdown and caused triggers to close and immediately reopen), and content slotted into the watched element counts as inside. Touch input is covered too: the target is captured while the `pointerdown` is still dispatching, before the outside check is deferred to the following `click`. The element passed to `shouldExcludeElement`, and the one the outside event is dispatched on, is the target as seen from the watched element's own tree. Siblings inside the same shadow root are reported as themselves, while interactions inside a foreign web component are still reported as its host, so existing `trigger.contains(element)` exclusions keep working for web-component triggers. Behavior for watched elements in the light DOM is unchanged. Target checks no longer use realm-bound `instanceof`, so outside detection also works for elements that belong to another realm, such as an iframe's document. - dd165cd: Make client-only effects transparent to Solid 2 hydration and call hydratable helpers’ onSettled on both server and client so later nodes bind correctly. - 50e36c9: Bump the `solid-js`/`@solidjs/web` peer and dev dependency range to `2.0.0-beta.20`. No API or behavior changes; beta.19/beta.20 introduced no breaking changes upstream (internal tree-shaking work, a new `solid-js/refresh` HMR entry point, and SSR/hydration/`lazy()` bug fixes). - c98cb2d: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals`/`babel-preset-solid` peer and dev dependency range to `2.0.0-rc.0`. No API or behavior changes on our end — this tracks upstream's move from the beta series into the release candidate. - 1b703e1: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.14`. - 638c530: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.9`, and `babel-preset-solid` to `2.0.0-rc.2`. Two behavior fixes were needed to keep up with upstream changes in this range: - `@solid-primitives/deep`: `captureStoreUpdates` no longer missed property changes. As of `2.0.0-rc.1` a store's `[$TRACK]` only fires for structural changes (key additions/removals), so leaf value changes stopped being reported. Each node's direct property values are now tracked individually. Updates are still reported at the shallowest node that actually changed. - `@solid-primitives/storage`: `makePersisted` no longer persists stale data. Signal writes stay pending until the next flush in `2.0.0-rc.1`+, so reading the value back inside the setter returned the _previous_ one — persisting stale data, or removing the stored entry entirely when the previous value was nullish. The value returned by the setter is now persisted directly. - Updated dependencies [89c5324] - Updated dependencies [5fc4efa] - Updated dependencies [4a5bf32] - Updated dependencies [dd165cd] - Updated dependencies [7ee755d] - Updated dependencies [50e36c9] - Updated dependencies [c98cb2d] - Updated dependencies [1b703e1] - Updated dependencies [638c530] - Updated dependencies [04a170e] - Updated dependencies [b7ef2f3] - Updated dependencies [5c23fda] - @solid-primitives/utils@7.0.0 ## 1.0.0-next.8 ### Patch Changes - 3f93f4a: `createInteractOutside` / `makeInteractOutside` now resolve interactions across shadow boundaries. An element rendered inside a shadow root no longer treats clicks, taps, or focus on its own content as outside interactions (which dismissed popovers on pointerdown and caused triggers to close and immediately reopen), and content slotted into the watched element counts as inside. Touch input is covered too: the target is captured while the `pointerdown` is still dispatching, before the outside check is deferred to the following `click`. The element passed to `shouldExcludeElement`, and the one the outside event is dispatched on, is the target as seen from the watched element's own tree. Siblings inside the same shadow root are reported as themselves, while interactions inside a foreign web component are still reported as its host, so existing `trigger.contains(element)` exclusions keep working for web-component triggers. Behavior for watched elements in the light DOM is unchanged. Target checks no longer use realm-bound `instanceof`, so outside detection also works for elements that belong to another realm, such as an iframe's document. ## 1.0.0-next.7 ### Patch Changes - dd165cd: Make client-only effects transparent to Solid 2 hydration and call hydratable helpers’ onSettled on both server and client so later nodes bind correctly. - Updated dependencies [dd165cd] - @solid-primitives/utils@7.0.0-next.7 ## 1.0.0-next.6 ### Patch Changes - 1b703e1: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.14`. - Updated dependencies [1b703e1] - @solid-primitives/utils@7.0.0-next.6 ## 1.0.0-next.5 ### Patch Changes - 638c530: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.9`, and `babel-preset-solid` to `2.0.0-rc.2`. Two behavior fixes were needed to keep up with upstream changes in this range: - `@solid-primitives/deep`: `captureStoreUpdates` no longer missed property changes. As of `2.0.0-rc.1` a store's `[$TRACK]` only fires for structural changes (key additions/removals), so leaf value changes stopped being reported. Each node's direct property values are now tracked individually. Updates are still reported at the shallowest node that actually changed. - `@solid-primitives/storage`: `makePersisted` no longer persists stale data. Signal writes stay pending until the next flush in `2.0.0-rc.1`+, so reading the value back inside the setter returned the _previous_ one — persisting stale data, or removing the stored entry entirely when the previous value was nullish. The value returned by the setter is now persisted directly. - Updated dependencies [7ee755d] - Updated dependencies [638c530] - @solid-primitives/utils@7.0.0-next.5 ## 1.0.0-next.4 ### Patch Changes - Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals`/`babel-preset-solid` peer and dev dependency range to `2.0.0-rc.0`. No API or behavior changes on our end — this tracks upstream's move from the beta series into the release candidate. - Updated dependencies - @solid-primitives/utils@7.0.0-next.4 ## 1.0.0-next.3 ### Minor Changes - b7ef2f3: `createHideOutside`/`ariaHideOutside` gain an opt-in `inert` option — in addition to `aria-hidden`, also sets the `inert` attribute on hidden elements, ref-counted alongside `aria-hidden`. `aria-hidden` alone only affects the accessibility tree; `inert` additionally removes hidden content from focus order, tab order, and pointer/text-selection interaction. Defaults to `false` (no behavior change for existing callers). Also hardened the module-scope ref-counting/observer-stack state (used internally by both the existing `aria-hidden` tracking and the new `inert` tracking) against duplicate installed copies of this package, via the same `globalRegistry` pattern used in `@solid-primitives/scroll`. ### Patch Changes - Updated dependencies [b7ef2f3] - @solid-primitives/utils@7.0.0-next.3 ## 1.0.0-next.2 ### Patch Changes - 50e36c9: Bump the `solid-js`/`@solidjs/web` peer and dev dependency range to `2.0.0-beta.20`. No API or behavior changes; beta.19/beta.20 introduced no breaking changes upstream (internal tree-shaking work, a new `solid-js/refresh` HMR entry point, and SSR/hydration/`lazy()` bug fixes). - Updated dependencies [50e36c9] - @solid-primitives/utils@7.0.0-next.2 ## 1.0.0-next.1 ### Patch Changes - c485250: fix: `makeInteractOutside`/`createInteractOutside` firing outside-interaction callbacks from an orphaned instance whose watched element was removed from the document before its reactive owner disposed (a common race when a dismissable layer closes and a new one opens in quick succession) ## 1.0.0-next.0 ### Major Changes - 9b2475d: Migrate to Solid.js v2.0 (beta.14) ### Patch Changes - Updated dependencies [89c5324] - Updated dependencies [4a5bf32] - @solid-primitives/utils@7.0.0-next.0