Major Changes
-
#3167
cb2ca19Thanks
@github-actions! - Breaking: Remove theportalledprop and the
api.portalledvalue.The popover now auto-detects whether its content is portalled (rendered outside the trigger's DOM subtree) and proxies
tab order accordingly — so forgetting to setportalledcan no longer break keyboard accessibility. Decide portalling
purely by where you render the content:- const service = useMachine(popover.machine, { id, portalled: true }) - const api = popover.connect(service, normalizeProps) - const Wrapper = api.portalled ? Portal : Fragment - <Wrapper> + <Portal> <div {...api.getPositionerProps()}>...</div> - </Wrapper> + </Portal>
To render inline, drop the
Portalwrapper (previouslyportalled: false); tab order is still handled automatically.
Minor Changes
-
#3167
d2b9972Thanks
@github-actions! - Addget<Part>State()getters (e.g.getTriggerState,
getContentState,getRootState), extending the existinggetItemStateconvention to every part with derived state.const triggerState = dialog.getTriggerState({ value: "confirm" }) // { value: "confirm", current: true, open: true }
Patch Changes
-
#3167
037af89Thanks
@github-actions! - Move layer stack styles and attributes into machine
connect props so framework renders cannot overwrite them.Breaking:
trackDismissableElementnow requiresonLayerChange. Apply the emitted snapshot's layer index,
nesting metadata, and pointer blocking state to the registered element through your framework's render output. -
#3167
8148d4dThanks
@github-actions! - Fix positioner appearing in the top-left corner on first
open (most visible in the Svelte adapter). The positioner now stays hidden off-screen via a CSS variable fallback in
transforminstead of apositioned-gatedopacity. This keeps the framework-managed style static, so reactive
re-renders no longer clobber the--x/--yvariables popper sets.As a result, the internal
positionedcontext flag is removed from positioned machines (popover, menu, select, etc.).Also fixes
cascade-selectpositioning: it now sets the initial placement before measuring and defers the first
placement computation (matching the other components), so it positions correctly on open — includingdefaultOpen. -
Updated dependencies [
037af89,
8148d4d]:- @zag-js/dismissable@2.0.0-next.1
- @zag-js/popper@2.0.0-next.1
- @zag-js/anatomy@2.0.0-next.1
- @zag-js/core@2.0.0-next.1
- @zag-js/types@2.0.0-next.1
- @zag-js/aria-hidden@2.0.0-next.1
- @zag-js/utils@2.0.0-next.1
- @zag-js/dom-query@2.0.0-next.1
- @zag-js/focus-trap@2.0.0-next.1
- @zag-js/remove-scroll@2.0.0-next.1