Skip to content

Commit

Permalink
fix(core): show placeholder block on the server with immediate trigger (
Browse files Browse the repository at this point in the history
#54394)

Currently all triggers are set up to show the placeholder block on the server, except for `on immediate` which is basically a noop. These changes update `on immediate` to match the rest of the triggers.

Fixes #54385.

PR Close #54394
  • Loading branch information
crisbeto authored and AndrewKushnir committed Feb 12, 2024
1 parent ef965ac commit 6d00115
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/defer/instructions.ts
Expand Up @@ -258,12 +258,13 @@ export function ɵɵdeferOnImmediate() {
const lView = getLView();
const tNode = getCurrentTNode()!;
const tView = lView[TVIEW];
const injector = lView[INJECTOR]!;
const tDetails = getTDeferBlockDetails(tView, tNode);

// Render placeholder block only if loading template is not present
// to avoid content flickering, since it would be immediately replaced
// Render placeholder block only if loading template is not present and we're on
// the client to avoid content flickering, since it would be immediately replaced
// by the loading block.
if (tDetails.loadingTmplIndex === null) {
if (!shouldTriggerDeferBlock(injector) || tDetails.loadingTmplIndex === null) {
renderPlaceholder(lView, tNode);
}
triggerDeferBlock(lView, tNode);
Expand Down

0 comments on commit 6d00115

Please sign in to comment.