Skip to content

fix: prevent modal reopen by settling canceled animation promises#9772

Open
christophmeise wants to merge 1 commit intoadobe:mainfrom
christophmeise:fix-modal-reopen
Open

fix: prevent modal reopen by settling canceled animation promises#9772
christophmeise wants to merge 1 commit intoadobe:mainfrom
christophmeise:fix-modal-reopen

Conversation

@christophmeise
Copy link

Closes #8786

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

Summary

  • Replace Promise.all(...) with Promise.allSettled(...) in useAnimation.
  • Ensure onEnd still runs when one or more animation.finished promises reject due to canceled or interrupted animations.
  • This addresses the modal reopening behavior tracked in #8786.

📝 Test Instructions:

  1. Build and run a production app that reproduces #8786.
  2. Open the navbar modal and click a navigation link.
  3. Navigate to a page containing Tailwind Typography prose content.
  4. Verify the modal does not reopen after navigation in Chrome.
  5. Verify normal enter/exit animation behavior still works and onEnd is called for uninterrupted animations.
  6. Interrupt or cancel an in-progress animation and verify cleanup still occurs even if an animation.finished promise rejects.

🧢 Your Project:

Personal contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-aria-components: Modal reopens after navigation when using RouterProvider with Next.js and Tailwind Typography in production (Chrome only)

1 participant