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

remove nested portals #2209

Merged
merged 3 commits into from
Aug 27, 2024
Merged

remove nested portals #2209

merged 3 commits into from
Aug 27, 2024

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Aug 27, 2024

Changes

This is a follow-up to #2185. Nested popovers now use the same portal container as un-nested ones.

I believe the original reasons for setting the portal container were so that (1) nested popovers don't appear below the parent and (2) nested popovers do not get rendered outside a ThemeProvider. Neither of these is a concern anymore because we now use a <ThemeProvider> at the end of <body> as the portal container for everything; anything rendered later will appear later in the DOM and therefore be rendered above (assuming everything else being equal).

Fixes #2205 (comment)

Note: #2156 is another issue where we might need to adjust portal containers (again). I will be looking into it after this PR.

Unrelated: I was getting react key errors when Table was rendered, so I fixed the keys passed to ColumnHeader.

Testing

Manually verified that the date filters in Table stories work ok (see screenshot).

Added e2e tests for:

  • DateRangeFilter (which uses Popover inside Popover).
  • ComboBox inside Popover (as an example of unrelated nested popovers).

I'm not sure why the visual test images changed, but the new images look correct so I approved them. The old ones were probably the reason for flaky tests.

Docs

Added patch changeset.

@mayank99 mayank99 self-assigned this Aug 27, 2024
@mayank99 mayank99 marked this pull request as ready for review August 27, 2024 18:07
@mayank99 mayank99 requested review from a team as code owners August 27, 2024 18:07
@mayank99 mayank99 requested review from r100-stack and smmr-dn and removed request for a team August 27, 2024 18:07
@mayank99 mayank99 changed the title fix portaling for nested popovers remove nested portals Aug 27, 2024
@mayank99 mayank99 merged commit d0de9f2 into main Aug 27, 2024
16 checks passed
@mayank99 mayank99 deleted the mayank/nested-popover-portal-fix branch August 27, 2024 21:44
@imodeljs-admin imodeljs-admin mentioned this pull request Aug 27, 2024
@mayank99 mayank99 mentioned this pull request Sep 3, 2024
1 task
@r100-stack r100-stack mentioned this pull request Oct 10, 2024
1 task
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.

3 participants