Popper-core: Wrong positioning when overflow-y:hidden is used on parent

Created on 29 Jan 2018  路  7Comments  路  Source: popperjs/popper-core

Wrong positioning on element that is inside an element with overflow-y: hidden or overflow-x: hidden (but not overflow:hidden).

https://codepen.io/anon/pen/WMNbxv

Result: Popper covers the reference element.
Expected: Popper on the left of the reference element.

It works in 1.12.6, but not in any newer version.

# BUG 馃悶 medium Fixed in v2 high core

Most helpful comment

@alecpl Does it work if you adjust the modifiers?

modifiers: {
  preventOverflow: {
    escapeWithReference: true
  }    
}

https://codepen.io/brentertz/pen/RQNZNM?editors=0010

All 7 comments

@alecpl Does it work if you adjust the modifiers?

modifiers: {
  preventOverflow: {
    escapeWithReference: true
  }    
}

https://codepen.io/brentertz/pen/RQNZNM?editors=0010

Yes. It works with this modifier setting.

Ok, from what I see Bootstrap 4 uses:

modifiers: {
  preventOverflow: {
    boundariesElement: 'scrollParent'
  }    
}

by default. I can fix the issue by setting the boundariesElement to 'window' or 'viewport'. And it's possible to set this via Bootatrsap's popover() boundary property. So, I have at least a workaround.

I don't understand why overflow-y and overflow-x shouldn't work but overflow should... We do check for all of them in the getScrollparent.js file.

@alecpl You have a typo in the boundariesElement key in your last example, it might be worth fixing for the benefit of the copy/pasters reading this

We seem to have the same or similar problem. I tried the preventOverflow suggestions, but no change.
Screenshot 2019-06-03 at 20 46 02
Screenshot 2019-06-03 at 20 44 54

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Johann-S picture Johann-S  路  3Comments

cixonline picture cixonline  路  5Comments

NilsEnevoldsen picture NilsEnevoldsen  路  5Comments

QJan84 picture QJan84  路  4Comments

skitterm picture skitterm  路  5Comments