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.

Is there a way to apply `flip` before `preventOverflow`?

See original GitHub issue

CodePen demo

https://codepen.io/Justineo/pen/QaypBM

Steps to reproduce the problem

  1. with placement set to bottom-start
  2. when the reference is on the right side of the container
  3. the popper is shifted (#pop)

What is the expected behavior?

Provide a way to apply flip when the popper is placed outside the container rather than shift it. (Like #pop2 in the CodePen demo.)

image

What went wrong?

Sometimes we want to flip the popper when it’s outside the container, not when it overlaps with the reference element.

Any other comments?

I’ve looked into how popper handles this now, but not sure how to handle this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:6

github_iconTop GitHub Comments

3reactions
arechsteinercommented, Dec 28, 2017

I’m facing this same problem when trying to implement a navigation menu.

I’ve tried setting the flip behavior but it doesn’t work as expected when the popper element overflows on the right side:

{
  placement: 'bottom-start',
  modifiers: {
    flip: {
      behavior: ['bottom-start', 'bottom-end']
    }
  }
}

In this shot the “Dropdown” in the top bar is the reference, and the expanded drop down menu is the popper element.

image

0reactions
Lehakoscommented, Sep 7, 2018

@FezVrasta any news about this feature?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to apply flip before preventOverflow ? #512
Provide a way to apply flip when the popper is placed outside the container rather than shift it. (Like #pop2 in the CodePen...
Read more >
Flip | Popper
The flip modifier can change the placement of a popper when it's scheduled to overflow a given boundary. Don't mind tech-related ads? Consider...
Read more >
How to flip the dropdown (Popover) uisng popper js
In my application am showing dropdown(Popover) from button left side. If button is in browser right edge. I want to show button right...
Read more >
Everything I Know About Positioning Poppers (Tooltips ...
In Popper, this is called the preventOverflow modifier. ... Flip visualization: the tooltip is flipped to the bottom from the top and fits ......
Read more >
All Props | Tippy.js - GitHub Pages
Prop Default Description plugins Specify plugins to use. See Plugins for details. role "tooltip" Specifies the role attribute on the tippy element. zIndex 9999 Determines the...
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