Menu: wrong calculated position with overlay="true"
See original GitHub issue1) Environment
- PrimeFaces version: 7.0.RC2
- Application server + version: Tomcat 7 and 9
- Affected browsers: All
2) Expected behavior
Calculated position of tag p:menu (overlay=“true”) on p:dialog is not dependent on the position of the scroll bar main window.
3) Actual behavior
Calculated position of tag p:menu (overlay=“true”) on p:dialog is dependent on the position of the scroll bar main window.
4) Steps to reproduce
Create page with vertival scroll bar. Open p:dialog with button with p:menu (overlay=“true”). p:menu position is dependent on the location of the scroll bar.
5) Sample XHTML
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body style="height: 1500px;">
<p:commandButton value="Modal" type="button" onclick="PF('dlg2').show();" />
<p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" position="top" height="150">
<h:form>
<h:outputText value="This is a Modal Dialog." />
<h3>Overlay</h3>
<p:commandButton id="dynaButton" value="Show menu" type="button" />
<p:menu overlay="true" trigger="dynaButton" my="left top" at="left bottom">
<p:menuitem value="Save" />
<p:menuitem value="Update" />
</p:menu>
</h:form>
</p:dialog>
</h:body>
</html>
Issue Analytics
- State:
- Created 5 years ago
- Comments:33 (30 by maintainers)
Top Results From Across the Web
How to overlay a TradingView script on the instrument?
overlay requires a literal true/false value. We can't use a dynamic value with this setting. When the script is on the chart and...
Read more >How to customize mat-select dropdown position?
I am using Angular. I have used the same property and it works fine with panelClass . But I used it this way...
Read more >Building Accessible Menu Systems - Smashing Magazine
In the true menus we'll be discussing shortly, this is the job of aria-haspopup="true" . Employing aria-controls doesn't really do much harm, ...
Read more >Overlay | Angular Material
This re-aligns the overlay element with the trigger in its last calculated position, even if a position higher in the "preferred positions" list...
Read more >CSS Position Sticky - How It Really Works! - Elad Shechter
I use it in real life for sticky summary tables, and I can think of sticky footer navigation, which can work very nicely...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I checked ColorPicker, SelectOneMenu and Menu(overlay=true). They all scroll fine in a Dialog positionTyp=“absolute”.
Please try this example; test.txt
I made some changes in align and show methods of Menu widget.
Position API Note: jQuery UI does not support positioning hidden elements. Please see; https://api.jqueryui.com/position/