Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update _modal.scss #30003

Closed
wants to merge 4 commits into from
Closed

Update _modal.scss #30003

wants to merge 4 commits into from

Conversation

zizoclimbs
Copy link

1- Fix ".modal-dialog-centered" class in mobile browsers as its not exactly centered because the browser add the height of "::before" to the content.
2- Remove ".modal {overflow-x: hidden;overflow-y: auto;}" it makes the modal content scrollable in mobile browsers if you tried to drag it.

1- Fix  ".modal-dialog-centered"  class in mobile browsers as its not exactly centered because the browser add the height of "::before" to the content.
2- Remove ".modal {overflow-x: hidden;overflow-y: auto;}" it makes the modal content scrollable in mobile browsers if you tried to drag it.
@zizoclimbs zizoclimbs requested a review from a team as a code owner January 12, 2020 11:18
@MartijnCuppens
Copy link
Member

Hi @Achmed4,

  • Could you provide a demo of what this fixes?
  • We try to avoid hacks like @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {, we should have a look at fixing this somehow else

@zizoclimbs
Copy link
Author

zizoclimbs commented Jan 12, 2020

Hi @Achmed4,

  • Could you provide a demo of what this fixes?
  • We try to avoid hacks like @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {, we should have a look at fixing this somehow else

Hi @MartijnCuppens

Please, Check this URL for video demo

As you can see when you first open the modal its not centered vertically and also if you tried to drag its content it will move.

This media query works only on IE and ::before styles are necessary for IE to center the modal.

@MartijnCuppens
Copy link
Member

@ysds, I can recall you applied some magic to center the modals in IE, could you check out what's going on here?

.modal {
overflow-x: hidden;
overflow-y: auto;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont remove these, because cause scrolling issue, see https://deploy-preview-30003--twbs-bootstrap.netlify.com/docs/4.3/components/modal/#scrolling-long-content and click the firse "Lanch demo modal".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix this by setting the code below on the "modal-body"
.modal-body { overflow-y: auto; max-height: 65vh; }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can extend ".modal-dialog-scrollable" placeholder inside our modal-dialog by default. It won't affect anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modal scrolls entirely by default. There are no plans to change this behavior.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this behavior causes the issue in the video. and what about the vertical centering and IE?

Copy link
Member

@ysds ysds Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing L11-14 has nothing to do with the problem in your video.

2- Remove ".modal {overflow-x: hidden;overflow-y: auto;}" it makes the modal content scrollable in mobile browsers if you tried to drag it.

It is a browser bug, see https://getbootstrap.com/docs/4.4/getting-started/browsers-devices/#overflow-and-scrolling

@ysds
Copy link
Member

ysds commented Feb 19, 2020

We try to avoid hacks like @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {, we should have a look at fixing this somehow else

I found a solution without CSS hack. I'm going to create a new PR, please see it. So close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants