Skip to content

fix: Iframe case for tooltip user component#4467

Draft
NathanZlion wants to merge 5 commits into
mainfrom
fix-iframe-button-disabled-reason
Draft

fix: Iframe case for tooltip user component#4467
NathanZlion wants to merge 5 commits into
mainfrom
fix-iframe-button-disabled-reason

Conversation

@NathanZlion
Copy link
Copy Markdown
Member

@NathanZlion NathanZlion commented Apr 24, 2026

Fix Iframe tooltip and Portal usage bugs.

Description

Related links, issue AWSUI-61932

How has this been tested?

Created Test Pages and did manual test and added Integ tests too.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@NathanZlion NathanZlion requested a review from a team as a code owner April 24, 2026 09:30
@NathanZlion NathanZlion requested review from a team and SpyZzey and removed request for a team and SpyZzey April 24, 2026 09:30
@NathanZlion NathanZlion changed the title Fix Iframe case for tooltip user component fix :Iframe case for tooltip user component Apr 24, 2026
@NathanZlion NathanZlion changed the title fix :Iframe case for tooltip user component fix: Iframe case for tooltip user component Apr 24, 2026
@NathanZlion NathanZlion force-pushed the fix-iframe-button-disabled-reason branch from 5b42dde to f80513c Compare April 24, 2026 12:48
@NathanZlion NathanZlion marked this pull request as draft April 24, 2026 12:49
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.40%. Comparing base (eb9e00b) to head (6e59666).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4467   +/-   ##
=======================================
  Coverage   97.40%   97.40%           
=======================================
  Files         933      934    +1     
  Lines       29486    29501   +15     
  Branches    10698    10701    +3     
=======================================
+ Hits        28720    28735   +15     
  Misses        718      718           
  Partials       48       48           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* Resolves the portal container to the ownerDocument.body of the referenced element.
* Ensures portaled content renders in the correct document context (e.g. inside iframes).
*/
export function usePortalContainer(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not let the Portal from component-toolkit use this by default? Is it not desired in general to append portal elements to the owner document instead of the child document if using an iframe?

This fix does not include feature prompt and popover, which also use Portal without arguments. Can they not be affected too? Fixing this as default behavior would address them out of the box.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, I noticed the feature prompt and the popover components. Wanted to minimize the PR size and add those as a follow up to make it easy to review.

Copy link
Copy Markdown
Member Author

@NathanZlion NathanZlion Apr 27, 2026

Choose a reason for hiding this comment

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

Why not let the Portal from component-toolkit use this by default?

Interesting, I don't see any argument against that. I think that would fix every single usecase no?

Copy link
Copy Markdown
Member Author

@NathanZlion NathanZlion Apr 27, 2026

Choose a reason for hiding this comment

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

But still defaulting to ownerDocument in the toolkit like here solves only half the problem. We still have to attach scroll listener to the right document, instead of glbal window.

@NathanZlion NathanZlion marked this pull request as draft April 30, 2026 10:23
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.

2 participants