Skip to content

Commit

Permalink
fix(dialog): remove hidden attr from positioner
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Nov 9, 2023
1 parent 8fb5e73 commit 259f358
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .changeset/thirty-chairs-tickle.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 0 additions & 2 deletions packages/machines/dialog/src/dialog.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export function connect<T extends PropTypes>(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",
},
Expand Down

4 comments on commit 259f358

@vercel
Copy link

@vercel vercel bot commented on 259f358 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 259f358 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-git-main-chakra-ui.vercel.app
zag-solid.vercel.app
zag-solid-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 259f358 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue-git-main-chakra-ui.vercel.app
zag-vue-chakra-ui.vercel.app
zag-vue.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 259f358 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-nextjs-chakra-ui.vercel.app
zag-two.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app

Please sign in to comment.