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

Notification component created even when toast is not triggered, causing z-index issues #2113

Open
pazfelipe opened this issue Sep 4, 2024 · 1 comment
Labels
bug Something isn't working triage

Comments

@pazfelipe
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v22.3.0
  • Nuxt Version: 3.13.1
  • CLI Version: 3.13.1
  • Nitro Version: 2.9.7
  • Package Manager: [email protected]
  • Builder: -
  • User Config: compatibilityDate, devtools, modules, plugins, runtimeConfig, i18n
  • Runtime Modules: @nuxt/[email protected], @nuxtjs/[email protected]
  • Build Modules: -

Version

v2.18.4

Reproduction

https://stackblitz.com/edit/nuxt-ui-jfdc58?file=app.vue,app.config.ts

Description

Description

The Nuxt UI notification component is currently being created and added to the DOM even when no toast has been triggered. This behavior leads to unintended consequences due to the component's z-index:

The notification component occupies part of the screen unnecessarily.
It overlaps other elements on the page due to its z-index, potentially disrupting the user interface.

Expected Behavior

The notification component should only be created and added to the DOM when a toast is actually triggered.

Current Behavior

The notification component is always present in the DOM, regardless of whether a toast has been triggered or not.

Steps to Reproduce

  • Implement the Nuxt UI notification component in a project.
  • Inspect the DOM without triggering any toasts.
  • Observe that the notification component is present and has a z-index applied.

Additional Context

This issue affects the usability and performance of applications using the Nuxt UI notification component. Resolving it would improve both the user experience and the overall efficiency of the component.

Possible Solution

Consider implementing a conditional rendering approach where the notification component is only added to the DOM when it's actually needed (i.e., when a toast is triggered).
Screenshot 2024-09-04 at 6 29 00 PM

Additional context

No response

Logs

No response

@pazfelipe pazfelipe added bug Something isn't working triage labels Sep 4, 2024
@duncandejong
Copy link

duncandejong commented Sep 18, 2024

i confirm this. It is blocking the ui.

this helped me, setting the pointer events of the notifications wrapper to none:
notifications: {
wrapper: 'fixed flex flex-col justify-end z-[55] pointer-events-none',
position: 'bottom-0 end-0',
width: 'w-full sm:w-96',
container: 'px-4 sm:px-6 py-6 space-y-3 overflow-y-auto',
},

Scherm­afbeelding 2024-09-19 om 00 11 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants