mmenu-js icon indicating copy to clipboard operation
mmenu-js copied to clipboard

Side effects on "fixed" CSS properties

Open TschePat opened this issue 3 years ago • 3 comments

Hi there,

I noticed a problem, that the rules "background-attachment: fixed;" and "position: fixed;" are not working anymore due to the "will-change: transform;" rule, that is set on a parent level by the mmenu.

I removed the rule and everything still seems to work fine. Maybe this rule is obsolete and can be removed?

TschePat avatar Jun 09 '22 10:06 TschePat

Thank you for reporting this. I'll remove it in the next version. Here's what MDN has to say about it:

Warning: will-change is intended to be used as a last resort, in order to try to deal with existing performance problems. It should not be used to anticipate performance problems.

Is your issue completely solved by removing this line? Once the menu opens, the page gets a transform applied to it, which probably results in the same issues.

FrDH avatar Jun 14 '22 17:06 FrDH

Just confirming similar behavior

Using Fixed and Absolute position elements anywhere in our page for any reason results in those elements being anchored to the bottom of the page, rather than fixed to the screen or absolutely within the element as expected. The "transform3d" rules applied to the governing tags (in my case: body) when disabled in the inspector fix the issue. But when overridden in my own CSS file, causes the menu to stop working entirely.

Going back to version 9.0.4 brought back my fixed elements, but introduced other.. bugs.. when collapsing the menu.

Crawled all the way back to 8.5.24 before everything worked correctly (Albeit with different search filter behavior)

RedactedProfile avatar Jul 16 '22 00:07 RedactedProfile

The will-change property will be removed in the next version. The transform3D property (when opening the menu) unfortunately can't be removed, at least not when the menu should appear from behind the page. If you need to remove the CSS rule, you could try using the reset value:

body{
   will-change: reset;
}

Hope this helps.

FrDH avatar Jul 26 '22 19:07 FrDH