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:
Added display: contents to extra wrapper divs to avoid potentially breaking layout.
Added similar performance improvements as Tooltip from #2004
Changes
Fixes #2006
The main issue was the use of
FloatingPortal
withoutroot
prop (defaults todocument.body
in the original window). I changed it to use the correct root element fromusePortalTo
(and therefore was also able to removePortal
).Tangential changes:
display: contents
to extra wrapper divs to avoid potentially breaking layout.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.
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.