Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conditionally mounted dialogs #2310

Merged
merged 3 commits into from Apr 25, 2023
Merged

Fix conditionally mounted dialogs #2310

merged 3 commits into from Apr 25, 2023

Conversation

diegohaz
Copy link
Member

@diegohaz diegohaz commented Apr 24, 2023

Closes #2309

It turns out that the nested dialog wasn't being added to the context fast enough. The solution this PR proposes is to sync with the store directly instead of relying on useSyncExternalStore.

@vercel
Copy link

vercel bot commented Apr 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ariakit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2023 11:23pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
reakit ⬜️ Ignored (Inspect) Apr 24, 2023 11:23pm

@changeset-bot
Copy link

changeset-bot bot commented Apr 24, 2023

🦋 Changeset detected

Latest commit: ea62a77

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@ariakit/react-core Patch
@ariakit/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 24, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ea62a77:

Sandbox Source
Ariakit Configuration

@diegohaz diegohaz merged commit 6ee390e into main Apr 25, 2023
15 checks passed
@diegohaz diegohaz deleted the dialog-nested-mounted branch April 25, 2023 17:22
@github-actions github-actions bot mentioned this pull request Apr 25, 2023
diegohaz pushed a commit that referenced this pull request Apr 26, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @ariakit/core@0.1.3

### Patch Changes

- Added support for native radio buttons within forms, that work with
roving tabindex, to all `focus` utilities.
([#2313](#2313))

- Updated validate and submit callbacks on `Form` so they always run in
a consistent order.
([#2319](#2319))

- Marked internal store functions as deprecated/experimental.
([#2316](#2316))

## @ariakit/react@0.1.5

### Patch Changes

- Fixed `FormRadio` error when not explicitly providing the composite
store. ([#2313](#2313))

- Fixed invariant error messages on `Menu` components.
([#2318](#2318))

- Updated validate and submit callbacks on `Form` so they always run in
a consistent order.
([#2319](#2319))

- Fixed nested `Dialog` components when they are conditionally mounted.
([#2310](#2310))

- Updated dependencies: `@ariakit/react-core@0.1.5`,
`@ariakit/core@0.1.3`.

## @ariakit/react-core@0.1.5

### Patch Changes

- Fixed `FormRadio` error when not explicitly providing the composite
store. ([#2313](#2313))

- Fixed invariant error messages on `Menu` components.
([#2318](#2318))

- Updated validate and submit callbacks on `Form` so they always run in
a consistent order.
([#2319](#2319))

- Fixed nested `Dialog` components when they are conditionally mounted.
([#2310](#2310))

-   Updated dependencies: `@ariakit/core@0.1.3`.

## @ariakit/test@0.1.4

### Patch Changes

-   Updated dependencies: `@ariakit/core@0.1.3`.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Animated nested dialog not opening
1 participant