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: sheets disappearing on re-renders #38

Merged
merged 3 commits into from
Sep 4, 2024
Merged

Fix: sheets disappearing on re-renders #38

merged 3 commits into from
Sep 4, 2024

Conversation

corasan
Copy link
Owner

@corasan corasan commented Sep 4, 2024

When the parent component re-rendered, the modal sheets would get a new ref which would then result in the modalStack trying to show modal sheets that no longer exist. Since the modalStack array is created and updated in the provider, the stack of opened sheets would remain the same and with the old refs.

This fix updates the modalStack with the new refs and restores the sheet to it's previous animated position.

@corasan corasan merged commit 59729b4 into main Sep 4, 2024
@corasan corasan deleted the fix/modal-stack branch September 4, 2024 23:25
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.

1 participant