Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose close event for USlideover (Overlay & Button) #3225

Closed
OmicronZed opened this issue Feb 2, 2025 · 3 comments
Closed

Expose close event for USlideover (Overlay & Button) #3225

OmicronZed opened this issue Feb 2, 2025 · 3 comments
Labels
enhancement New feature or request triage v3 #1289

Comments

@OmicronZed
Copy link

Description

I’ve been using USlideover from NuxtUI (v3), and I noticed that there’s no event triggered when clicking on the overlay (outside of the slideover). This makes it tricky to detect when a user dismisses it by clicking outside, rather than using the close button.

It would be super helpful if USlideover emitted an event whenever it’s closed—whether that’s via the close button or the overlay. That way, we could easily handle any necessary logic when the slideover is dismissed.

If exposing a close event isn’t feasible, maybe the overlay could be made accessible as a slot? That way, we could wrap it in our own template and attach a @click event directly. This would give us more flexibility in handling interactions.

I took a look at the source code, and it seems like these interactions are already handled internally, but they aren’t exposed as events:
🔗 Slideover.vue

Would be awesome to see this in a future update.

Additional context

No response

@OmicronZed OmicronZed added enhancement New feature or request triage v3 #1289 labels Feb 2, 2025
Copy link
Member

Did you try using the @update:open event? 🤔

https://ui3.nuxt.dev/components/slideover#control-open-state

@OmicronZed
Copy link
Author

I’ve already tried that :(. The 'open' status remains false, even when the Slideover is actually open.

I should also mention that I'm opening the Slideover programmatically.

slideover.open(UserSlideover, ...)

@benjamincanac
Copy link
Member

Closing as this should be fixed using useOverlay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage v3 #1289
Projects
None yet
Development

No branches or pull requests

2 participants