upmostly / modali

A delightful modal dialog component for React, built from the ground up to support React Hooks.
213 stars 23 forks source link

opening modal causes whole document to shift right #7

Closed UnnitMetaliya closed 5 years ago

UnnitMetaliya commented 5 years ago

not sure that's meant to be like that or it's bug.

jcrowson commented 5 years ago

Can you provide a screenshot so I can verify?

jcrowson commented 5 years ago

@UnnitMetaliya This will be fixed in v1.1.1.

coffenbacher commented 5 years ago

What did this turn out to be?

I noticed that the scroll bar disappears on the window (if present) which results in a small shift. Is that this?

coffenbacher commented 5 years ago

@jcrowson I'm testing on 1.1.1 and I'm actually still seeing a related issue. On 1.1.0 I was seeing a scrollbar disappear and push everything to the right, but now on a non-scrollbar page, a white strip is popping up and pushing everything to the left:

Is it related to the resolution for this one, or is this a different issue?

No modal: image

With modal: image

Thanks!

joshuaiz commented 5 years ago

This is due to the css in modali.css:

@media (min-width: 1025px) {
     .modali-open {
          padding-right: 15px; // comment this out
     }
}

Comment that out and you should be good. This should be fixed in the next update.

mk0y commented 4 years ago

Is this fixed? It's still happening on Chrome desktop: https://upmostly.github.io/modali/

joshuaiz commented 3 years ago

Ended up adding this to my own css to fix:

body.modali-open {
    padding-right: 0 !important;
    overflow-x: hidden !important;
}

body.modali-open #root {
    overflow-x: hidden !important;
}