Skip to content

fix: dynamically calculate toast cleanup timeout from CSS transition …#88

Open
nolostra wants to merge 1 commit intoknadh:masterfrom
nolostra:fix/toast-transition-timeout
Open

fix: dynamically calculate toast cleanup timeout from CSS transition …#88
nolostra wants to merge 1 commit intoknadh:masterfrom
nolostra:fix/toast-transition-timeout

Conversation

@nolostra
Copy link

@nolostra nolostra commented Feb 19, 2026

Fixes #89

Replace hardcoded 200ms timeout with dynamic calculation that reads the transition duration from computed styles. This ensures the timeout always matches the CSS transition duration, even if it changes.

  • Calculate duration after setting data-exiting attribute
  • Handle multiple transition durations by taking the maximum
  • Fallback to 200ms if calculation fails
  • Force reflow to ensure styles are applied before reading

@nolostra nolostra force-pushed the fix/toast-transition-timeout branch 3 times, most recently from ef23016 to 40de9fa Compare February 19, 2026 21:14
…duration

Fixes knadh#87

Replace hardcoded 200ms timeout with dynamic calculation that reads
the transition duration from computed styles. This ensures the timeout
always matches the CSS transition duration, even if it changes.

- Calculate duration after setting data-exiting attribute
- Handle multiple transition durations by taking the maximum
- Fallback to 200ms if calculation fails
- Force reflow to ensure styles are applied before reading
@nolostra nolostra force-pushed the fix/toast-transition-timeout branch from 40de9fa to 6853df9 Compare February 19, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toast: hardcoded cleanup timeout

1 participant

Comments