bootstrap
bootstrap copied to clipboard
[Offcanvas menu] Opposite fixed element bug in Chrome
Here is an example of this bug (just open it in Chrome and click to show the offcanvas): https://jsfiddle.net/07cLvwd3/2
+1 menu should not modify position if the fixed element is not relate to menu
If right
isn't set, the offcanvas plugin sees it as right: 0
instead of right: auto
.
As a workaround add
.bs-sidebar.affix {
right: auto !important;
}
https://jsfiddle.net/07cLvwd3/3/
@jasny Workaround is not working in supplyed fiddle, fixed block disappears.
@MikiSoft @chouex I'm not sure if it is a bug. If fixed content stays unmoved, but rest of the page moves, it will break visual page structure, and can look bad, depending on page. So if you really need to not move some fixed elements, you can use the following workaround:
- add an element, that you need to keep not moved, to excludes: (e.g. add
data-exclude=".bs-sidebar"
to toggle menu button) - set
left
orright
property of that fixed element to some numerical value (otherwise, although it is positioned relatively to viewport, it will move when body is moved to the left or right)
Example is in here: https://jsfiddle.net/07cLvwd3/4/
@jasny What should we do in here?