Topic: Navbar links move to the left when opening modal
Hi - when adding a modal to my page, whenever the modal opens the navbar links move to the left onscreen. I'm assuming this is something to do with the scrollbar width but I have no idea how to prevent this from happening.
Any ideas would be most appreciated.
Thank you
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Resolved
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.5.14
- Device: PC
- Browser: All
- OS: Win 10
- Provided sample code: No
- Provided link: No
Related topics
Piotr Glejzer staff commented 6 years ago
Hi,
may you our snippets to show your problem? Thanks.
https://mdbootstrap.com/snippets
Best,
Piotr
SGalway pro commented 6 years ago
https://mdbootstrap.com/snippets/jquery/sgalway/213225
If you click the open modal button the links on the navbar move to the left about 15px. Pretty certain it's beacuse of the scrollbar but I have no idea how to prevent it?
Any thoughts or ideas would be great :-)
Thank you for replying.
Piotr Glejzer staff commented 6 years ago
Hi,
yea I see a problem with this. I made resaerch and it's bug from bootstrap. I added this to our 'bug list' to fix that as soon as possible. Sorry about that.
Best,
Piotr
SGalway pro commented 6 years ago
Any idea on a workaround/hack that might work in the short term?
Thanks for the reply.
Steve
SGalway pro commented 6 years ago
This appears to solve the issue - at least in Chrome and Firefox
.modal-open .navbar-expand-lg {
padding-right: 16px !important;
}
Cheers
Steve
Piotr Glejzer staff commented 6 years ago
Thanks for your solution. Have a nice day.