Skip to content

fix(react): bind events properly for overlays rendered within a nav#31159

Merged
ShaneK merged 1 commit into
mainfrom
FW-6314
May 20, 2026
Merged

fix(react): bind events properly for overlays rendered within a nav#31159
ShaneK merged 1 commit into
mainfrom
FW-6314

Conversation

@ShaneK
Copy link
Copy Markdown
Member

@ShaneK ShaneK commented May 20, 2026

Issue number: resolves #27843


What is the current behavior?

createInlineOverlayComponent renders inline overlays (modal, popover, etc.) inside a <template> at their declared JSX position. When the overlay presents, CoreDelegate teleports the DOM node into ion-app, but React's synthetic event delegation root stays at the original JSX parent. Once the overlay lives outside that subtree, React no longer dispatches events to children inside it, so onClick, onChange, and other handlers inside an IonModal rendered within an IonNav silently stop firing

What is the new behavior?

Top-level inline overlays now render through createPortal into the same ion-app container that CoreDelegate teleports into, so React's event root follows the DOM

Does this introduce a breaking change?

  • Yes
  • No

Other information

This issue also reports the same problem in Vue, but that was fixed in #30227

Preview: navigation-modal

Dev build:

8.8.8-dev.11779302602.17decfbf

@ShaneK ShaneK requested a review from a team as a code owner May 20, 2026 18:15
@ShaneK ShaneK requested a review from OS-jacobbell May 20, 2026 18:15
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment May 20, 2026 6:26pm

Request Review

@github-actions github-actions Bot added the package: react @ionic/react package label May 20, 2026
Copy link
Copy Markdown
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! 👍

@ShaneK ShaneK added this pull request to the merge queue May 20, 2026
@brandyscarney brandyscarney removed this pull request from the merge queue due to a manual request May 20, 2026
@ShaneK ShaneK changed the title fix(react): portal inline overlays so React events reach children after teleport fix(react): bind events properly for overlays rendered within a nav May 20, 2026
@ShaneK ShaneK added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit fa4593d May 20, 2026
65 checks passed
@ShaneK ShaneK deleted the FW-6314 branch May 20, 2026 20:20
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.

bug: react/vue, rendering modal within nav does not bind events

2 participants