components
components copied to clipboard
fix(cdk/scrolling): Prevent virtual scroll 'flickering' with zoneless
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.