Skip to content

fix: prevent nested portal conflicts between ConfirmationButton and ConfirmationModal#1313

Merged
rubinaga merged 1 commit intomainfrom
fix/confirmationbutton-portal
Feb 11, 2026
Merged

fix: prevent nested portal conflicts between ConfirmationButton and ConfirmationModal#1313
rubinaga merged 1 commit intomainfrom
fix/confirmationbutton-portal

Conversation

@rubinaga
Copy link
Contributor

Done

  • ConfirmationButton now passes its Portal to ConfirmationModal via portalRenderer instead of wrapping it directly.
  • ConfirmationModal now prioritizes portalRenderer, then renderInPortal, then inline render.
  • Added regression tests for confirm click flow, ignored portal overrides, and portal precedence behavior.

QA

Pinging @canonical/react-library-maintainers for a review.

Storybook

To see rendered examples of all react-components, run:

yarn start

QA in your project

from react-components run:

yarn build
npm pack

Install the resulting tarball in your project with:

yarn add <path-to-tarball>

QA steps

  • Open a ConfirmationButton example and click the trigger button.
  • Verify the modal opens and stays open (does not immediately close).
  • Click the modal confirm button and verify the confirm callback fires exactly once.
  • Verify Esc/outside-click close behavior still works in ConfirmationButton flow.
  • Render ConfirmationModal standalone with default props and verify it renders inline (not in portal).
  • Render standalone ConfirmationModal with renderInPortal={true} and verify it renders in a portal.
  • Render ConfirmationModal with both renderInPortal={true} and a custom portalRenderer and verify the custom renderer is used.

@webteam-app
Copy link

Copy link
Contributor

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

LGTM.

@rubinaga rubinaga merged commit b736e73 into main Feb 11, 2026
9 checks passed
@rubinaga rubinaga deleted the fix/confirmationbutton-portal branch February 11, 2026 18:35
@github-actions
Copy link

🎉 This PR is included in version 3.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants