Misaligned popper position
See original GitHub issueCodeSandbox demo
https://codesandbox.io/s/magical-kowalevski-4b9nw?file=/src/Popover.js
Steps to reproduce the problem
Check the provided codesandbox and play around with window width as this bug is not always visible
What is the expected behavior?
I’d expect the right border of both the reference element and popper element to be perflectly aligned.
What went wrong?
There is a slight 1px misalignment.
Any other comments?
I noticed that this bug occurs when both the x
position and width
of the reference element are decimals.
It looks like Popper incorrectly calculates the position of the element.
I’ve added logger
modifier so that you can check console in the codesandbox to see and compare the resulting value provided by Popperjs
and the one provided by me (which seems to be correct).
I also played around with roundOffsets
, gpuAcceleration
and nothing seems to fix this issue.
I’d consider this issue a high priority as it basically defeats the purpose of using this otherwise very useful library.
I’m happy to help with fixing this issue if someone would provide me with some guidance 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Ok nevermind, looked again, Popper bug, lol
@FezVrasta @atomiks sorry for the late reply, but unfortunately it looks like your PR does not 100% fix the issue. Take a look at the videos:
https://user-images.githubusercontent.com/20651022/109499396-238b9c80-7a95-11eb-8766-e5636c11f648.mov
https://user-images.githubusercontent.com/20651022/109499401-25556000-7a95-11eb-9e57-799722e5af05.mov
As you can see the right side border of the popper element is changing position while I’m scrolling, it occurs both in the provided codesandbox (although same as previously you have to play with screen width, as it does not occur all the time) and other project where I’m using popper.