-
Notifications
You must be signed in to change notification settings - Fork 67
fix: enable reopening overlay after close() with overlay.open
#187
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
Conversation
🦋 Changeset detectedLatest commit: 5681fe1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #187 +/- ##
==========================================
- Coverage 93.99% 93.55% -0.44%
==========================================
Files 12 12
Lines 333 357 +24
Branches 80 88 +8
==========================================
+ Hits 313 334 +21
- Misses 19 22 +3
Partials 1 1
🚀 New features to boost your workflow:
|
6677660 to
5681fe1
Compare
Description
This PR fixes a bug where overlays could not be reopened after being closed when using the same overlay ID. The issue occurred because the overlay state management didn't properly handle the case where an overlay was closed and then reopened with the same identifier.
Related Issue: Fixes #186
Changes
isMountedproperty toOverlayItemtype to track overlay mounting stateADDaction in reducer to handle reopening of existing closed overlaysOverlayProviderto detect overlay state changes and trigger proper reopeningOPENaction to setisMounted: truewhen opening overlaysuseRefto track previous overlay state for comparisonMotivation and Context
Previously, when an overlay was closed and then reopened with the same overlay ID, the overlay would not properly display again. This was because the overlay state management system didn't distinguish between completely new overlays and overlays that were being reopened after being closed. The system would skip the reopening process for existing overlay IDs, even if they were in a closed state.
This fix ensures that:
How Has This Been Tested?
Screenshots (if appropriate):
N/A - This is a functional bug fix without visual changes
Types of changes
Checklist
Further Comments
This fix addresses a critical issue that could affect user experience when working with modal/overlay patterns. The solution maintains backward compatibility while ensuring proper state management for overlay reopening scenarios.