iTwin / iTwinUI

A design system for building beautiful and well-working web interfaces.
https://itwin.github.io/iTwinUI/
MIT License
92 stars 35 forks source link

correctly portal `Popover` into the main `portalContainer` #2009

Closed mayank99 closed 1 week ago

mayank99 commented 2 weeks ago

Changes

Fixes #2006

The main issue was the use of FloatingPortal without root prop (defaults to document.body in the original window). I changed it to use the correct root element from usePortalTo (and therefore was also able to remove Portal).

Tangential changes:

Also see comment about TimePicker/ColorPicker: https://github.com/iTwin/iTwinUI/pull/2009#discussion_r1569266375

Testing

Tested by recreating the linked issue in local playground. The filter popover appears in the correct window.

image

Added a unit test for it as well.

Unrelated: I noticed we didn't have any existing unit tests for Popover, so I added a few. Can be improved further in the future.

Docs

Added changeset.