react-overlays icon indicating copy to clipboard operation
react-overlays copied to clipboard

popperConfig.placement isn't honoured

Open woro83c opened this issue 6 years ago • 5 comments

Supplying the placement option to the popperConfig object doesn't seem to have any effect. It looks like it gets overridden by the placement prop, here:

https://github.com/react-bootstrap/react-overlays/blob/master/src/DropdownMenu.js#L144

I was hoping to centre the menu, i.e.:

<DropdownMenuBase flip popperConfig={{ placement: 'bottom' }} />

Cheers!

woro83c avatar May 28 '19 05:05 woro83c

Why can't you use the placement prop?

taion avatar May 28 '19 13:05 taion

Unless I'm mistaken(?), there doesn't seem to be an option to centre the menu.

woro83c avatar May 29 '19 08:05 woro83c

There isn't yeah, We should maybe add one. In general tho the reason it's not respected is that Dropdown is supposed to be more opinionated about placement than a tooltip or plain popper usage, since it's a specific implementation. Centering tho is something we should allow

jquense avatar May 29 '19 12:05 jquense

any update on this?

woro83c avatar Sep 05 '19 02:09 woro83c

We’d be happy to take a PR here.

taion avatar Sep 05 '19 02:09 taion