primereact icon indicating copy to clipboard operation
primereact copied to clipboard

OverlayPanel: Popup Direction support

Open Achill113 opened this issue 3 years ago • 7 comments

Describe the feature you would like to see added

  • Ability to specify what direction an OverlayPanel should pop

Is your feature request related to a problem?

Currently, if the trigger for an OverlayPanel is at the bottom of the page, the panel itself gets cut off without any way to specify to pup up instead of down.

Describe the solution you'd like

Either automatically detecting that the panel will be cut off and change directions (like a right-click menu does on windows) or the ability to specify the direction manually.

Describe alternatives you have considered

Overlay panel causes page height to increase rather than being cut off.

Additional context

No response

Achill113 avatar Jun 08 '22 19:06 Achill113

Similar to https://github.com/primefaces/primereact/issues/1933 so if a solution is found it should be applied to both components

melloware avatar Jun 08 '22 19:06 melloware

This is one important feature which is missing. Really the only one preventing me from committing to using this Design system :)

kevin19940627 avatar Aug 06 '22 05:08 kevin19940627

Hmm I know there is FlipFitCollision detection that is supposed to automatically flip the panel up if its at the bottom of the screen but maybe that is not working properly?

melloware avatar Aug 06 '22 11:08 melloware

Good to know, but like many other libraries, boundary detection and the ability to specify popover direction seems like an important aspects of a popover :)

kevin19940627 avatar Aug 06 '22 11:08 kevin19940627

Yep agreed.

melloware avatar Aug 06 '22 11:08 melloware

sorry and hover trigger as well. thanks

kevin19940627 avatar Aug 06 '22 11:08 kevin19940627

Yep this is an open community so PR's are welcome if you end up implementing this or are interested in helping out.

melloware avatar Aug 06 '22 11:08 melloware

So I just tested this and the overlay panel if the button is at the bottom of the page opens UP.

Can you try this: https://codesandbox.io/s/condescending-monad-u2mo3o?file=/src/demo/OverlayPanelDemo.js ???

melloware avatar Dec 09 '22 19:12 melloware

@melloware I just tested this, and I do see that it appears to work as intended.

Achill113 avatar Dec 09 '22 19:12 Achill113

Thanks I will close this for now. It must have gotten fixed along the way

melloware avatar Dec 09 '22 19:12 melloware