Jump to content

How in tailwindcss make modal dialog when page has horizontal scrolling?


mstdmstd
 Share

Recommended Posts

Hello,
Basing on tailwindcss 2 modal example https://alpinetoolbox.com/examples/modal
I make modal dialog with setting max-h-screen class, like
 

<div class="overflow-auto" role="dialog" style="background-color: rgba(0,0,0,0.5)" x-show="showModal"
:class="{ 'absolute inset-0 z-50 flex items-center justify-center': showModal }"
@keydown.escape.window="showModal = false"
>
<!--Dialog-->
<div
class="flex flex-col sm:h-4/5 md:h-4/6 max-h-screen justify-between rounded shadow-lg py-4 text-left px-6 modal-container"
x-show="showModal" @click.away="showModal = false" x-transition:enter="ease-out duration-300"
x-transition:enter-start="opacity-0 scale-90" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="ease-in duration-300" x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-90">



and it works ok, untill page has no horizontal scrolling.

If page has horizontal scrolling - then only part of the page is with modal and space below is
empty and this makes page

I also tried to use max-h-full instead of max-h-screen, but no effect.

How can I made it ?

Thanks!
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.