I have recreated a minimal reproducible example for the following question p:calendar popup remain below from calendar input in dialog when scroll (on IE and Chrome). I have also been encountering this issue and just figured out what was happening but I do not know how to fix it. The appendTo
suggestion in the referenced question for selectOneMenu
does not seem to be an attribute we can apply to the calendar.
Here is how to reproduce:
If the parent window is scrolled to the top, the calendar popup on the dialog is positioned correctly
If the parent window is scrolled down a little, the calendar popup on the dialog is positioned a little further down from the input box
The distance offset is seems relative to the amount the parent window is scrolled.
the
top
value seems to be the culprit.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui" xmlns:pe="http://primefaces.org/ui/extensions" xmlns:o="http://omnifaces.org/ui" xmlns:of="http://omnifaces.org/functions">
<h:head>
<title>Calendar</title>
</h:head>
<h:body>
<h1>Calendar Popup Issue PF 8.0</h1>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h:panelGrid id="gridId">
<h:panelGrid id="panelId">
<h:form id="laborForm">
<p:commandButton oncomplete="PF('dialogWv').show()" title="Click to open dialog" update="dialogId" value="Open dialog with popup time only calendar" />
</h:form>
</h:panelGrid>
</h:panelGrid>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<p:dialog id="dialogId" header="Test" dynamic="true" widgetVar="dialogWv" modal="true" showEffect="fade" hideEffect="fade"
resizable="true" width="400px" height="100px">
<h:form id="formId">
<p:panelGrid style="margin-bottom: 5px; border: 2px; width: 100%;" id="pg1">
<p:row>
<p:column colspan="2">
<p:calendar value="#{cc.attrs.viewBean.backfitTime}" timeOnly="true" pattern="HH:mm" showMillisec="false" showSecond="false" required="true"
requiredMessage="Time is required" rendered="true" />
</p:column>
</p:row>
</p:panelGrid>
<br />
</h:form>
</p:dialog>
</h:body>
</html>
EDIT I am unable upgrade to PF10 at the moment due to too much of my site's look and feel getting broke with 10. So my short term fix was just to use the datePicker but with PF8. But the datePicker with PF8 doesn't render nice. Plus the mouse pointer covers the hour and minute numbers when incrementing up.
Clicking an up or down arrow is inefficient.