palantir/blueprint

Toast animations do not work when multiple toasts are supposed to be animating

Open

#4,516 opened on Feb 3, 2021

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
P3Package: coreType: bughelp wanted

Description

Environment

  • Package version(s): 3.38.2
  • Operating System: macOS 10.15
  • Browser name and version: Chrome 88.0.4324.96 (Official Build) (x86_64)

Code Sandbox

Link to a minimal repro: https://blueprintjs.com/docs/#core/components/toast

Steps to reproduce

  • Click any of the toast creation buttons in quick succession
  • OR set a low maximum and try to create a new toast once reaching the maximum
  • OR create a bunch of toasts and then clear() them all at once

Actual behavior

Only the newest/topmost (toast[0]) toast will actually animate, the rest will just instantly snap to their final state.

Expected behavior

All of the toasts will go through their full enter/exit animations.

Possible solution

Not a React guy but the common thread with this bug seems to be that only one animation will play at a time and when multiple animations should be playing only the toast at index 0 actually animates.

Contributor guide