Skip to content

Conversation

@sins051301
Copy link

solution2.mp4

What

Restores stacked toast behavior on mobile by ensuring the toast group expands again when the user taps outside the toast container. On desktop, existing hover behavior remains unchanged.

Why

On mobile devices, stacked toasts could not be expanded again after being collapsed.
This happened because mobile browsers do not trigger focus/blur or mouseenter/mouseleave events reliably. As a result, the logic that re-expanded the toast stack on outside interaction never fired.
This PR introduces a mobile-friendly interaction model to fix that.

How

Added a pointerdown-based outside click handler to detect taps outside the toast container on mobile.
When a pointerdown occurs outside the container, the toast stack is expanded again.
The change applies only to mobile/touch behavior and does not affect desktop hover interactions.
Removed reliance on focus-based logic for mobile platforms.
This ensures the stack collapses and re-expands correctly across both desktop and mobile environments.

Testing

Tested on Chrome mobile emulator (iOS & Android).
Tested on physical Android device.

Confirmed:

Tapping outside the toast on mobile re-expands the stacked toasts.
Desktop behavior (hover expand/collapse) remains unchanged.
No regressions in existing autoClose or hover pause features.

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