ThomasLeconte / vuetify3-dialog

Vue 3 & Vuetify 3 plugin to create dialogs (confirm, warn, error), toasts or bottom-sheets with Promises anwsers.
https://www.npmjs.com/package/vuetify3-dialog
MIT License
26 stars 9 forks source link

Vuetify 3.5.17 breaks Snackbar/notify #16

Closed Shaxine closed 6 months ago

Shaxine commented 6 months ago

It seems that Vuetify 3.5.17 added (VSnackbar): position based on app layout: https://github.com/vuetifyjs/vuetify/commit/cbb945d68086044f04cb13ef245dc4b4cb73392 which breaks the mount of the snakbar component.

[Vue warn]: injection "Symbol(vuetify:layout)" not found. 
  at <VSnackbar class="vuetify3-dialog-snackbar" timeout=3000 location="top right"  ... > 
  at <Snackbar text="Hello world!" level=undefined location="top right"  ... > [runtime-core.esm-bundler.js:47:12](http://localhost:3000/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js)

[Vue warn]: Unhandled error during execution of setup function 
  at <VSnackbar class="vuetify3-dialog-snackbar" timeout=3000 location="top right"  ... > 
  at <Snackbar text="Hello world!" level=undefined location="top right"  ... > [runtime-core.esm-bundler.js:47:12](http://localhost:3000/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js)

Uncaught (in promise) Error: [Vuetify] Could not find injected layout
    useLayout layout.ts:92
    setup VSnackbar.tsx:99
    setup defineComponent.tsx:121
...

I could reproduce the error after upgrading vuetify version of the test setup to 3.5.17.

ThomasLeconte commented 6 months ago

Hi 👋 Thanks for report! I fixed it (https://github.com/ThomasLeconte/vuetify3-dialog/commit/2a5246048ae66114d39cdfbd79efe19c1658a00b) in new version 1.4.7 😉

Shaxine commented 6 months ago

Thank you for the quick fix! I can confirm that it's working!