-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Inconsistent modal positioning #261
Comments
What do you suggest? |
Reasonable question. I'd recommend remembering the value of bodyIsOverflowing and scrollbarWidth before opening modal dialog. Next thing to do would be checking the most recent code in Bootstrap. It seems to work. And, of course, considering modalIsOverflowing may change while dialog is open. |
OK @sergeymorkovkin I've had a look at it and the original plugin, so let me give you a suggestion: open
Do all the tests you can think of and let me know how it works. I am now considering that perhaps we were over-doing some things. |
That worked perfectly for static modals! Whenever I resize the window, modal always persists it's position. However, when content height changes dynamically and modalIsOverflowing changes, the modal dialog shifts either right (when modal height shrinked) or left (when modal height expanded). Conslusion is we still need these functions. |
I think if you also comment line 1183 in the |
@sergeymorkovkin please disregard the previous and download latest master, give it a try, let me know how it goes. |
Can't confirm it's good, unfortunately. It possibly works consistently with the original bootstrap modal, but positioning is not correct yet. I've prepared a file with the context I use. It should simplify things for you. |
I think the way of the original plugin looks is a bit off, I think our script does it better slightly, and I am very happy with the result to be honest. Also please try the upcoming 2.0.25 version (MASTER) not the CDN version 2.0.24. |
Agree. We're at least trying to manage these scrollbars. I've tried version from master and my comment is about it. |
I don't think the positioning is OFF in any shape or form, it just looks normal in any circumstance. |
Try checking either of those chechboxes and then open modal. Here's how it works in Chrome 71. |
Interestingly I cannot confirm this at all in my testing, it's always consistent, but later on I found you're using this CSS
UPDATE: Only use this CSS to do the test, and you'll surely see no alignment issue: .form {
position: absolute;
z-index: 10000;
}
.container {
background: red;
}
.overflow-body,
.overflow-modal {
display: none;
}
body.body-is-overflowing .overflow-body {
display: inline-block;
}
body.modal-is-overflowing .overflow-modal {
display: inline-block;
} |
It's masking the problem, not solving. In my use case the dialog should perfectly fit container width from both sides. |
I will commit new code in a couple minutes. |
* Further fixes for #261 * toast-native.js was missing
* Further fixes for #261 * toast-native.js was missing
@sergeymorkovkin we good? |
Not really :( Whenever the "Modal is overflowing" is checked, the modal shifts left by the width of the scrollbar. Other cases seem to be okay with your last version. |
Well I think it's pointless to go beyond possibility, I think the component behavior is as close to the original plugin as will ever be, I am very happy with the outcome and consider the issue to be truly closed. Thanks for reporting and best of luck. |
I've tested the most recent version and was able to make it work the way I need by enforcing modal scrollbar. Whoever might need it, please use:
Thank you for your great support! |
This is caused by the fact that checkScrollbar() results different values when scrollbar is hidden.
The text was updated successfully, but these errors were encountered: