diff --git a/.changeset/thirty-chairs-tickle.md b/.changeset/thirty-chairs-tickle.md new file mode 100644 index 0000000000..420ab9192f --- /dev/null +++ b/.changeset/thirty-chairs-tickle.md @@ -0,0 +1,8 @@ +--- +"@zag-js/dialog": patch +--- + +Fix issue where dialog positioner applied the `hidden` attribute when closed leading to pre-mature exit of css +animations applied to the dialog content. + +> Only the backdrop and content should use the `hidden` attribute. diff --git a/packages/machines/dialog/src/dialog.connect.ts b/packages/machines/dialog/src/dialog.connect.ts index 6f2a5e303f..9debea931b 100644 --- a/packages/machines/dialog/src/dialog.connect.ts +++ b/packages/machines/dialog/src/dialog.connect.ts @@ -42,9 +42,7 @@ export function connect(state: State, send: Send, normalize positionerProps: normalize.element({ ...parts.positioner.attrs, dir: state.context.dir, - hidden: !isOpen, id: dom.getPositionerId(state.context), - "data-state": isOpen ? "open" : "closed", style: { pointerEvents: isOpen ? undefined : "none", },