From 0ff501d4aa28b64a11a3d9a6101e3f997a9e9795 Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Tue, 07 Jan 2025 18:29:08 +0100
Subject: [PATCH] teleport per spostare il dialog in una posizione consona nel DOM

---
 10 - course project/xno-prj-cmp-01-starting-setup/src/components/UI/BaseDialog.vue |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/10 - course project/xno-prj-cmp-01-starting-setup/src/components/UI/BaseDialog.vue b/10 - course project/xno-prj-cmp-01-starting-setup/src/components/UI/BaseDialog.vue
index c63603d..0e692bb 100644
--- a/10 - course project/xno-prj-cmp-01-starting-setup/src/components/UI/BaseDialog.vue
+++ b/10 - course project/xno-prj-cmp-01-starting-setup/src/components/UI/BaseDialog.vue
@@ -1,20 +1,22 @@
 <template>
-  <div @click="$emit('close')"></div>
-  <dialog open>
-    <header>
-      <slot name="header">
-        <h2>{{ title }}</h2>
-      </slot>
-    </header>
-    <section>
-      <slot></slot>
-    </section>
-    <menu>
-      <slot name="action">
-        <base-button @click="$emit('close')"></base-button>
-      </slot>
-    </menu>
-  </dialog>
+  <teleport to="body">
+    <div @click="$emit('close')"></div>
+    <dialog open>
+      <header>
+        <slot name="header">
+          <h2>{{ title }}</h2>
+        </slot>
+      </header>
+      <section>
+        <slot></slot>
+      </section>
+      <menu>
+        <slot name="action">
+          <base-button @click="$emit('close')"></base-button>
+        </slot>
+      </menu>
+    </dialog>
+  </teleport>
 </template>
 
 <script>

--
Gitblit v1.8.0