-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popup menu positioning #1054
Comments
I think this is a valid point. I tried wrapping the parent div to |
I had to extend TieredMenu and TieredMenuSub with my own classes and switch to using |
I'm also experiencing this issue. In my case when I attach a menu through a template to the data table component it shows up far away from the expected position. |
I have the same problem, my menu was offscreen way to the right of my toggle button. |
Find solution here . |
If |
It did not work for me |
I can't replicate with 2.0.5, feel free to create a new issue ticket with plunkr. |
I was experiencing this problem when the menu was within a positioned element. The menu is positioned with |
Thanks @ajshapiro that fixed it for me too |
I am having this problem in react the menu is showin up way to the right and too low. i cannot use the appendTo="body" with react... any ideas how to fix this with react. |
You probably want to post this to the primereact issue tracker. This is the primeng issue tracker, so it's highly unlikely you'll find the answer here. |
@lucas-wade primereact's Menu has an |
the solution is appendTo = "body" as they indicate in angular 9 for example my dashboard have different div and library css and function
|
The idea of using appendTo="body" works visually until you try to scroll. Now, the menu is not 'attached' to a particular element and the content scrolls 'under' the menu resulting in undesired effects. It would be better to stop scrolling from happening when appendTo body is used. I would simply use this option all the time on that basis. |
Can you please suggest a solution where in my case i want to scroll when appendTo='body' is used |
Thank you @Prontsevich . I am using primeNG 16 and appendTo="body" did fix it for me. |
In my none of that works. Unfortunately i had to style in my .scss: |
I'm trying to add a popup menu in one of my projects, but the positioning of the menu is way off. I took a look at what was going on in the code, and it seemed like something strange was happening in the call to domHandler.absolutePosition() from menu.show(). It was calculating the correct offsets from the parent element, but, rather than applying the 'top' and 'left' properties relative to the browser window, it applied them relative to the parent element, so my menu was offscreen way to the right of my toggle button, instead of directly beneath it as desired.
When I changed the position attribute from absolute to fixed for .ui-menu-dynamic selector, it positioned the menu correctly, but never set the display attribute back to 'block' after hiding the menu in domHandler.getHiddenElementDimensions(). I'm currently setting the visibility back to block in my own code as a workaround, but it would be nice not to have to resort to that.
Didn't have anything too different from the demo page in terms of my template (below), so not sure why it would be behaving differently, but it certainly is.
The text was updated successfully, but these errors were encountered: