components icon indicating copy to clipboard operation
components copied to clipboard

fix(material/snack-bar): Ensure snackbar enter/exit works with OnPush ancestor

Open atscott opened this issue 1 year ago • 0 comments

By updating the "arbitrary-component" to OnPush, the following test fails: MatSnackBar should set the old snack bar animation state to complete and the new snack bar animation.

The assertion that fails is the afterDismissed spy, which never gets called. Adding markForCheck in the exit ensures the _animationState is applied to the host and completes. If this is not done, the following listener never executes, including the _completeExist: '(@state.done)': 'onAnimationEnd($event)'.

atscott avatar Dec 26 '23 22:12 atscott