Skip to content

fix(cdk/scrolling): Prevent virtual scroll 'flickering' with zoneless - #31240

Closed
atscott wants to merge 2 commits into
angular:mainfrom
atscott:scrollflicker
Closed

atscott wants to merge 2 commits into
angular:mainfrom
atscott:scrollflicker

Conversation

@atscott

@atscott atscott commented May 28, 2025 •

Copy link
Copy Markdown
Contributor

This fixes the perceived flickering due to the transform sometimes becoming visible with zoneless due to the macrotask-based scheduler. The transform cannot be simply moved inside afterNextRender because it causes differences in timing that can break certain scroll implementations (http://b/335066372).

This approach fiddles with the details of ngZone.run and avoiding unnecessary extra ApplicationRef.tick calls. We could instead put everything inside an ngZone.run and call ApplicationRef.tick in there, but that would result in a second tick when the ngZone.run exits.

fixes #29174

@atscott
atscott requested a review from a team as a code owner May 28, 2025 14:39
@atscott
atscott requested review from crisbeto and ok7sai and removed request for a team May 28, 2025 14:39
@atscott atscott added the target: patch This PR is targeted for the next patch release label May 29, 2025
atscott added 2 commits July 8, 2025 12:13
This fixes the perceived flickering due to the transform sometimes becoming visible with zoneless due
to the macrotask-based scheduler. The transform cannot be simply moved
inside `afterNextRender` because it causes differences in timing that
can break certain scroll implementations (http://b/335066372).

This approach fiddles with the details of `ngZone.run` and avoiding
unnecessary extra ApplicationRef.tick calls. We could instead put
everything inside an ngZone.run and call ApplicationRef.tick in there,
but that would result in a second tick when the `ngZone.run` exits.

Fixes angular#29174
@atscott

atscott commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

closing in favor of #31316

@atscott atscott closed this Jul 16, 2025
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Aug 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: cdk/scrolling target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(cdk/scrolling): virtual-scroll flickers during scroll in zoneless mode

2 participants