Skip to content

Conversation

@quentingiraud-ugo
Copy link

@quentingiraud-ugo quentingiraud-ugo commented Dec 17, 2025

πŸ”— Linked issue

Resolves #5694

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR fixes an issue where the Modal component closes unexpectedly on touch devices after interacting with other overlay elements (like Toast).

Problem

On touch devices, when a user:

  1. Opens a modal
  2. Triggers a toast notification from inside the modal
  3. Taps the same button again after the toast appears/disappears

The modal closes unexpectedly as if the user tapped outside the modal overlay.

Solution

Added a pointerDownOutside handler that prevents the modal from closing when:

  • The event target is no longer in the DOM (e.g., toast was dismissed)
  • The event target is part of another dismissable layer (e.g., toast, popover)

This ensures the modal only closes on intentional interactions outside its content.

Testing

Added a "Modal with toast" example in the playground (/components/modal) to reproduce and test this behavior on touch devices.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2025

npm i https://pkg.pr.new/@nuxt/ui@5695

commit: 52cbc27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modal closes unexpectedly on touch after interacting with Toast overlay

1 participant