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> that references a target inside an overflow:hidden container?

See original GitHub issue

I have poppers that are rendered inside overflow:hidden containers; this causes the poppers to be partially hidden/cropped.

@FezVrasta has indicated that this should be achievable by putting the <Popper> somewhere outside of the overflow:hidden container have it reference the target.

I’m not sure how to do this with react-popper, though. Any ideas/advice?

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
FezVrastacommented, Sep 21, 2017

You have two possibilities:

  1. Use something like react-portal to move the popper element somewhere else (usually body):
<Manager>
  <Reference />
  <Portal><Popper /></Portal>
</Manager>
  1. Manually define the structure:
<Manager>
  <div style={{ overflow: 'hidden' }}>
    <Reference />
  </div>
  <Popper />
</Manager>
0reactions
clintharriscommented, Sep 21, 2017

I found a work-around:

class MyTooltip extends React.Component {
  render() {
    if(!this.props.show) {
      return this.props.children;
    }
    return (
      <Manager>
        <Target>{this.props.children}</Target>
        <Portal isOpened={true}>
          <Popper placement={arrowLocation} className="popper" style={style}>
            Here's the popper's contents...
            <Arrow className="popper__arrow" style={arrowStyle}/>
          </Popper>
        </Portal>
      </Manager>
    );
  }
}

I think I’m just gonna roll with this for now. Thanks for the tip on portal and quick responses!

Read more comments on GitHub >

github_iconTop Results From Across the Web

<Popper> that references a target inside an overflow:hidden ...
I have poppers that are rendered inside overflow:hidden containers; this causes the poppers to be partially hidden/cropped.
Read more >
Prevent Overflow - Popper
The preventOverflow modifier prevents the popper from being cut off by moving it so that it stays visible within its boundary area. Don't...
Read more >
Everything I Know About Positioning Poppers (Tooltips ...
To solve this, Popper attaches a scroll listener to the container and on each fired scroll event, recalculates the position of the popper....
Read more >
Bootstrap dropdown clipped by overflow:hidden container ...
My question, how can I solve this clipping issue, e.g. change the container of all dropdowns inside my project to be body ,...
Read more >
How to Build a Dynamically Positioned Popover with Popper ...
js in Divi to create a dynamically positioned popover (the pop-up box) that is revealed when clicking on the popover's reference (the button)....
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