question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misaligned popper position

See original GitHub issue

CodeSandbox 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.

Zrzut ekranu 2021-01-25 o 14 37 58

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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
FezVrastacommented, Feb 25, 2021

Ok nevermind, looked again, Popper bug, lol

0reactions
mkrdscommented, Mar 1, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Misaligned popper position · Issue #1223
I noticed that this bug occurs when both the x position and width of the reference element are decimals. It looks like Popper...
Read more >
Popper.js wrong initial position of dropdown/tooltip
When popper opened and i scroll the position of popper is updated - this state need to be initial. I found that CSS...
Read more >
1903196 – Popover positioning is misaligned for Overview ...
Description of problem: Popover arrows that are positioned to the right are not vertically aligned with dashboard status items.
Read more >
Flip
When using variation placements (e.g. top-start ), the popper will attempt to flip the opposite variation if the preferred variation does not fit....
Read more >
replacing popping kettle in 512 series popcorn popper
Guide the popping kettle (1) upward until the kettle release handle (6) engages the kettle latch (14) to secure the kettle in its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found