primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.58k stars 990 forks source link

SlideMenu: Allow position control #2579

Open xreider opened 2 years ago

xreider commented 2 years ago

Hello! Is there any methods to position Slide Menu relative to the triggering element ?

melloware commented 2 years ago

Yes isn't that the appendTo property?

DOM element instance where the overlay panel should be mounted. Valid values are any DOM Element and 'self'. The self value is used to render a component where it is located.

xreider commented 2 years ago

I mean positions like 'center-bottom', 'right-top' and others like in tippy.js library

melloware commented 2 years ago

oh you mean like "where" it slides to right now it just has collision detection and either slides up or down depending on where the button is on the screen. You want control over where it renders. Understood.

xreider commented 2 years ago

oh you mean like "where"

Yes. And if I set 'top', but the triggering element on the top edge of screen, menu would open of the bottom of triggering element. etc

While there is no such function, I am forced to use tippy, inside which I embed the primereact's slide menu or use react components with react-components-group

melloware commented 2 years ago

This does seem like a nice feature request. I know Primereact tooltips have positioning and there is this ticket for adding more positions: https://github.com/primefaces/primereact/issues/2438

It may be they could reuse the same code for SlideMenu.