I have an issue with will-change
. I have no idea why it causes this problem but when I add will-change
on wrapper in which I have list with hidden divs (which should show up on hover) it breaks showing that divs. t shows part of it or not at all (depends on browser). Do you have any idea why it breaks that functionality?
Link -> http://jsbin.com/rukanajugi/1/edit?html,css,output
Contrary to common belief, the will-change property may actually have an impact on the visual appearance of the element, as it creates a new CSS Stacking Context if used with Stacking Context Creating Properties (e.g. position
, opacity
, transform
) BEFORE the actual transformation was made.
This may therefore change the layout, as the order of the layers (which element is above which one) may be changed.
In your case, the creation of the new Stacking Context through will-change: opacity
, causes the layout issue. The hidden div
s are positioned absolute, therefore don't increase the size of their parents/grandparents and are therefore cropped by the .menu-wrapper
, which now has a stacking context.
You have multiple solutions for this, e.g.
.menu-wrapper { overflow: visible; }
.menu-wrapper { height: 200px; }
will-change
attribute. E.g. using .menu-wrapper { will-change: border-width; }
won't create any Stacking Context. As Soon as your .menu-wrapper gets properties, which create a Stacking Context (e.g. opacity: 0.9999
), it will break again, however.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With