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

Add Scope handling for Portal Containers #829

Closed metin-kale closed 6 months ago

metin-kale commented 6 months ago

In #781 we added portalling, but portals currently do not inherit any scope.

In this PR portal-containers get a scope of some defined parent tags.

We have two types of portals:

Bound to the ViewPort:

These Portals will inherit the Scope of the PortalRoot, which inherits the Scope of its parent (usually the main render Function). Both the portalRoot() function and the global render() function got a scope parameter, so the user can set scopes as for every tag.

The second type of portals is bound to a reference element:

These portals inherit the scope of their reference element, to which they get aligned.