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.

Popper is 5px left offset when using auto, bottom, and bottom-start

See original GitHub issue

CodePen demo

https://codepen.io/Saturn2888/pen/dgLyqK

Steps to reproduce the problem

  1. Remove margin on HTML body.
  2. Put an reference DOM node at 0x0.
  3. Add a popper element on the body for that reference DOM node.
  4. Popper has a 5px left offset. This happens using auto, bottom, and bottom-start.

What is the expected behavior?

It should be left-aligned with the reference DOM node like it is in every other situation.

What went wrong?

It looks like it’s arbitrarily adding a 5px left offset:

transform: translate3d(5px, 100px, 0px)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Sawtaytoescommented, Oct 29, 2018

Just so I can help out others having the same issue:

In Popper’s 3rd arg, pass in the options object with the prop like so:

new Popper(
  referenceNode,
  popperNode,
  {
    modifiers: {
      preventOverflow: {
        padding: 0,
      },
    },
  }
)

From the docs:

Name Type Default Description
padding number 5 Amount of pixel used to define a minimum distance between the boundaries and the popper. This makes sure the popper always has a little padding between the edges of its container
1reaction
FezVrastacommented, Oct 29, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Popper is 5px left offset when using auto, bottom, and ... - GitHub
This happens using auto , bottom , and bottom-start . What is the expected behavior? It should be left-aligned with the reference DOM...
Read more >
Popper (v1.×)
Popper.placements : enum. List of accepted placements to use as values of the placement option. Valid placements are: auto; top; right; bottom; left....
Read more >
Team:PYMS GZ China/JS popper - iGEM 2020
marginTop; boundaries.bottom = height + offsets.top; boundaries.left += ... Utility used to transform the `auto` placement to the placement with more ...
Read more >
popper.js - UNPKG
marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += ... the `auto` placement to the placement with more\n * available space.
Read more >
v-tooltip3 - npm Package Health Analysis - Snyk
Easy tooltips, popovers and dropdown with Popper.js ... <button v-tooltip.bottom-start="'You have ' + count + ' new messages.'">.
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