Some updates to dialog example

This commit is contained in:
Ryan Gossiaux
2021-12-13 21:57:53 -08:00
parent a4e55d7167
commit 092fdd595d
2 changed files with 58 additions and 60 deletions

View File

@@ -10,25 +10,25 @@
<DialogOverlay class="fixed inset-0 bg-gray-500 opacity-25" />
<div
class="z-10 fixed left-12 top-24 bg-white w-96 p-4 transform"
style={`translate(calc(50px * ${level}), calc(50px * ${level}))`}
style={`transform: translate(calc(50px * ${level}), calc(50px * ${level}))`}
>
<p>Level: {level}</p>
<div class="space-x-4">
<button
class="bg-gray-200 px-2 py-1 rounded"
onClick={() => (showChild = true)}
on:click={() => (showChild = true)}
>
Open (1)
</button>
<button
class="bg-gray-200 px-2 py-1 rounded"
onClick={() => (showChild = true)}
on:click={() => (showChild = true)}
>
Open (2)
</button>
<button
class="bg-gray-200 px-2 py-1 rounded"
onClick={() => (showChild = true)}
on:click={() => (showChild = true)}
>
Open (3)
</button>

View File

@@ -130,7 +130,7 @@
</MenuButton>
</span>
<TransitionChild
<TransitionRoot
enter="transition duration-300 ease-out"
enterFrom="transform scale-95 opacity-0"
enterTo="transform scale-100 opacity-100"
@@ -138,7 +138,6 @@
leaveFrom="transform scale-100 opacity-100"
leaveTo="transform scale-95 opacity-0"
>
<Portal>
<MenuItems
class="z-20 w-56 mt-2 origin-top-right bg-white border border-gray-200 divide-y divide-gray-100 rounded-md shadow-lg outline-none"
>
@@ -193,8 +192,7 @@
</MenuItem>
</div>
</MenuItems>
</Portal>
</TransitionChild>
</TransitionRoot>
</Menu>
</div>
</div>