jwstegemann / fritz2

Easily build reactive web-apps in Kotlin based on flows and coroutines.
https://www.fritz2.dev
MIT License
627 stars 25 forks source link

Fix Mountpoint in Portals #837

Closed metin-kale closed 6 months ago

metin-kale commented 6 months ago

In #829 we implemented a special scope inheritance for portal containers. Because of that the MountPoint (which is stored as Scope) was also overwritten.

The MountPoint is also used for afterMounts/afterUnmounts, which are currently broken in portals. Therefore FocusTrap does also not always work in Modals.

With this PR the MountPoint in Portals got fixed, so that afterMounts/afterUnmounts continue to work as expected

henryB99 commented 6 months ago

Looks good to me. I would prefer not exposing MOUNT_POINT_KEY, but I see no other alternative.