Skip to content

Animate toast height so the deck doesn't flicker under a resting pointer - #6243

Merged
senadir merged 1 commit into
trunkfrom
fix/toast-hover-flicker
Nov 30, 2026
Merged

senadir merged 1 commit into
trunkfrom
fix/toast-hover-flicker

Conversation

@senadir

@senadir senadir commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

What

Adds height to the toast transition so it animates alongside transform.

Why

Reported in #studio: with two toasts showing ("Logged in to WordPress.com" + "Pulling changes..."), resting the pointer near the top edge of the back toast makes the deck flicker between spread and collapsed.

The back toast's height depends on the deck state: its own height when spread, the front toast's (taller) height when collapsed. Height had no transition but transform did, so on collapse the back toast snapped to the taller height while still sitting in its spread position. That grew it upward under the pointer, which re-entered the viewport, spread the deck, shrank the toast, the pointer left again, and so on.

With height and transform animating together, the toast's top edge moves in one direction during each transition, so it doesn't cross back over a pointer that isn't moving. Base UI's own toast example transitions height the same way.

Testing

I didn't reproduce the loop in a browser; this comes from frame-by-frame reading of the screen recording and the deck CSS. To check: trigger two toasts of different heights (e.g. log in and start a pull), hover so the deck spreads, then park the pointer just above the top toast's top edge. Before: flicker. After: the deck collapses once and stays.

View in Indent View in Slack
Tag @indent to continue the conversation here.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: senadir is a trusted author.

@senadir
senadir merged commit 388cf54 into trunk Nov 30, 2026
13 checks passed
@senadir
senadir deleted the fix/toast-hover-flicker branch November 30, 2026 13:37
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.

1 participant