floating-ui: strategy: fixed is broken if its parent has will-change
CodeSandbox
https://codesandbox.io/s/misty-resonance-n18pt
Steps to reproduce the problem
- Open CodeSandbox
- A tooltip is positioned inside container
What is the expected behavior?
The same positioning as without will-change
.
What went wrong?
Disabling of gpuAcceleration
will not work 😭
Any ideas why it happens? How it can be fixed?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 29 (17 by maintainers)
So if you manually broke behaviour to make it consistent across browsers, then I think you should at least add option for user to calculate containing block on popper side. This don’t need to be default “on”, but if somebody needs better behaviour in strategy fixed then should be able to do this. As i described - either option “on”/“off” for containing block calculation or some getter function which can be modified by developers who use popper.
Please consider this, as for now in our use cases popper@1 behavior is better at this time. Also due to regression in popper@2 in this behaviour - popper@1 should not be marked as deprecated in npm registry.
Thanks for the report! Most likely the logic we use to detect offset parents is not taking in account the new render context generated by the
will-change: transform
property.https://github.com/popperjs/popper-core/blob/master/src/dom-utils/getOffsetParent.js