fix(select): blank panel with virtualScroll + lazy in dialog (#19423
Open
khaledbaghdadii wants to merge 1 commit into
Open
fix(select): blank panel with virtualScroll + lazy in dialog (#19423khaledbaghdadii wants to merge 1 commit into
khaledbaghdadii wants to merge 1 commit into
Conversation
…ndTo on zoneless apps (primefaces#19401) - Add onOverlayAfterEnter hook to trigger detectChanges after overlay animation - p-scroller init was skipped when isVisible() returned false during animation - In zoneless CD strategy, no automatic CD cycle retriggers the initialization - New method forces CD after overlay is fully visible - Add regression test for virtual scroll + lazy loading in dialog with zoneless CD
|
I've got the same issue with the overlay in my TreeSelect component. Running this manually after the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19401
Problem
When
p-selectis configured with[virtualScroll]="true"and[lazy]="true"inside ap-dialogwith
appendTo="body", the dropdown panel opens blank. Items only appear after an additional userinteraction (click, keypress).
Root Cause
p-motion'safterRenderEffectusesawait nextFrame()(doublerequestAnimationFrame), whichcauses execution to escape
NgZone. TheonAfterEnteranimation callback fires outside NgZone,so the scroller's entire initialization chain (
init → setTimeout → calculateOptions → onLazyLoad)runs outside the zone. Angular never detects the subsequent item updates, leaving the panel blank.
Fix
Add an
onOverlayAfterEnterhandler that re-enters NgZone viazone.run()before triggeringcd.detectChanges(). This ensures all downstream async operations (setTimeout, lazy load events,data fetches) are intercepted by zone and trigger change detection when they resolve.