Popper-core: Can't force placement in desired position

Created on 17 Jul 2017  路  4Comments  路  Source: popperjs/popper-core

I'd like to be able to force a given position, regardless of scroll, layout, etc. After looking through the docs thoroughly, it does not appear that this is an option at present.

CodePen demo

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

Steps to reproduce the problem

  1. Visit above codepen
  2. Change popper settings to get popper to always position on top (doesn't appear to be possible)

What is the expected behavior?

A setting to have the popper always located in the desired position (e.g. 'top')

What went wrong?

Popper shows in different position because of layout (in this case the bottom).

Any other comments?

This feels like very basic functionality, so if this is possible please know that it is not at all clear how to go about it. Also I have found configurations that seem to work in chrome but not safari or firefox.

Most helpful comment

OK, after playing with it a bit, the following works:

modifiers: {
  flip: {
    enabled: false 
  },
  preventOverflow: {
    escapeWithReference: true
  }
}

Codepen

It's not entirely clear to me why this works, so consider this a general issue of documentation. Thanks for your help!

All 4 comments

You shoud be able to disable the flip modifier to force the position

OK, after playing with it a bit, the following works:

modifiers: {
  flip: {
    enabled: false 
  },
  preventOverflow: {
    escapeWithReference: true
  }
}

Codepen

It's not entirely clear to me why this works, so consider this a general issue of documentation. Thanks for your help!

We already have an issue to improve the preventOverflow modifier usability

setting flip to false fixed my issue, thanks

Was this page helpful?
0 / 5 - 0 ratings