Skip to content

fix(overlay): prevent detached DOM nodes during React inline overlay dismiss #30344

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

Closed
wants to merge 1 commit into from

Conversation

ShaneK
Copy link
Member

@ShaneK ShaneK commented Apr 8, 2025

Issue number: resolves internal


What is the current behavior?

Currently, the inline overlay component calls setState on dismiss that can cause the component to rerender when it's otherwise trying to be removed from the DOM, preventing elements that should be removed from the DOM from being removed from memory and leading to detached nodes.

What is the new behavior?

We no longer call setState on dismiss. It shouldn't really be necessary anyway, because after dismiss in this case the entire component should be destroyed ultimately. This prevents things that were removed from the DOM from being re-rendered by React and hanging around in memory, preventing detached nodes.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@ShaneK ShaneK requested a review from a team as a code owner April 8, 2025 16:39
@ShaneK ShaneK requested a review from brandyscarney April 8, 2025 16:39
Copy link

vercel bot commented Apr 8, 2025

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

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 4:39pm

@github-actions github-actions bot added the package: react @ionic/react package label Apr 8, 2025
@ShaneK ShaneK closed this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: react @ionic/react package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant