Skip to content

fix: teleport renders all outlets when multiple are registered before navigation#31

Merged
arturovt merged 1 commit intomainfrom
fix/issue-20
Mar 25, 2026
Merged

fix: teleport renders all outlets when multiple are registered before navigation#31
arturovt merged 1 commit intomainfrom
fix/issue-20

Conversation

@arturovt
Copy link
Copy Markdown
Collaborator

BehaviorSubject replays only its single most recent value, so when two outlets ('title' and 'actions') were registered before a child route's *teleportTo subscribed, only the last-registered outlet name was replayed — the first outlet's teleported content was silently dropped.

Adding startWith(name) to outlet$() makes each new subscription immediately probe the current ports map for its target outlet instead of waiting for a future newOutlet emission that has already fired. Outlets not yet registered still work as before — they wait for the real BehaviorSubject event.

Adds a regression test modelling the reported app-bar title + actions pattern (persistent shell with two outlets, child page with two teleportTo directives).

… navigation

BehaviorSubject<string> replays only its single most recent value, so
when two outlets ('title' and 'actions') were registered before a child
route's *teleportTo subscribed, only the last-registered outlet name was
replayed — the first outlet's teleported content was silently dropped.

Adding startWith(name) to outlet$() makes each new subscription
immediately probe the current ports map for its target outlet instead of
waiting for a future newOutlet emission that has already fired. Outlets
not yet registered still work as before — they wait for the real
BehaviorSubject event.

Adds a regression test modelling the reported app-bar title + actions
pattern (persistent shell with two outlets, child page with two
teleportTo directives).
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@arturovt arturovt linked an issue Mar 25, 2026 that may be closed by this pull request
@arturovt arturovt merged commit 4638934 into main Mar 25, 2026
2 checks passed
@arturovt arturovt deleted the fix/issue-20 branch March 25, 2026 20:23
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.

Outlet disappear on navigation when multiple outlets are in use

1 participant