nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Modal not fully visible on small (little height) screens

Open YassBaer opened this issue 1 year ago • 8 comments

NextUI Version

v2.2.9

Describe the bug

When using a "shallow" monitor (for a lack of a better word, i.e. one with very little height) and/or very high modals, the top part of the modal can become unreachable through scrolling. We have higher modals in our application so it became apparent there, but the behavior is the same with the modals from the docs as you can see in the video and by testing it yourself.

It seems like scroll-behavior: outside fixes this, but imo content should never become unreachable. Maybe scrollBehavior: outside should become the default or it should at least be documented more explicitly that one should use outside when experiencing such behavior.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Go to the Modal Docs
  2. Use a screen with very little height (or use the responsive view inside chrome dev tools) (roughly 450px height)
  3. Make sure to stay above the 'sm:'-Threshold for the width. (It works on small screens, probably because modals are placed differently there)
  4. Open the first Modal in the docs and try to scroll to see the heading

Expected behavior

As a user, I expected to be able to scroll to see the entirety of the content within the modal.

Screenshots or Videos

https://github.com/nextui-org/nextui/assets/82964083/ebea0a9b-f45d-400b-a5e2-a9048030a334

Operating System Version

macOS, tested on Windows as well

Browser

Chrome

YassBaer avatar Feb 27 '24 11:02 YassBaer

I also wait for fix this

There is a way that helped me

  1. for the div that wraps the section (wrapper in classNames props), you need to add align-items: unset; justify-content: unset; text-align: center; padding: 4rem 1.5rem;
  2. for the section (className props) add margin: auto; text-align: left;

now the popup should scroll correctly

EliseevDanil avatar Mar 03 '24 00:03 EliseevDanil

Scrolling simply doesn't happen in either scroll type. I've tested it on MacOS (Safari and Firefox) and Ubuntu (Firefox). In all configurations, my own code behaves similarly to the NextUI website, where the modal pops up with content unreachable and no ability to scroll to it.

https://github.com/nextui-org/nextui/assets/46287074/b99986ad-3933-4960-a753-87aecf673823

In the video attached, you can see the scroll bars showing up on the right-hand side of the screen, but nothing happens to the modal.

I also want to point out that it's not just small screens. My 4K screens render the same situation.

srmlcn avatar Apr 04 '24 00:04 srmlcn

Also experiencing this issue, a big problem for landscape on mobile

daveycodez avatar Jun 19 '24 01:06 daveycodez

bump!

EtherealData avatar Nov 11 '24 06:11 EtherealData

I couldn't reproduce in the latest doc page. Please help share a video.

wingkwong avatar Nov 11 '24 07:11 wingkwong

@wingkwong You can resize your window to reproduce this issue. I did it using inspect element: Screencast from 2024-12-23 17-34-46.webm

mrdaano avatar Dec 23 '24 16:12 mrdaano

Bump. This is pretty bad. I can reproduce on https://www.heroui.com/docs/components/modal with the first modal by shrinking my chrome's window height.

Just tried @EliseevDanil's fix https://github.com/heroui-inc/heroui/issues/2413#issuecomment-1974961874 which looks good!

WesleyKapow avatar Apr 23 '25 21:04 WesleyKapow

01 August 2025, unresolved

datapanthom avatar Sep 01 '25 21:09 datapanthom