OverlayPanel: z-index issue
See original GitHub issueThe contents of an opened <p:overlayPanel>
should be at the top (speaking in z-dimension) and cover other contents. However, if the <p:overlayPanel>
is used inside a <p:tabView>
, this is not the case for `<p:commandButton> components. They cover the overlayPanel!
A picture is worth a thouthands words:
To me this seems like a CSS bug, but I couldn’t find out, what the actual problem is. It seems, opacity, position and transform are related, but I couldn’t say definitely.
Reproducer Run this simple XHTML and click the “click me” text to reproduce:
<h:form id="myForm">
<p:tabView id="tabView" >
<p:tab title="Test">
<h:outputText id="trigger" value="click me" />
<p:overlayPanel for="trigger" style="background-color: #4c4c4c;">
<h1 style="padding:1em">Some big Tooltip</h1>
</p:overlayPanel>
</p:tab>
</p:tabView>
<div><p:commandButton value="p:commandButton" /></div>
<div><h:commandButton value="h:commandButton"/></div>
<div><p:panel>p:panel - hello</p:panel></div>
</h:form>
Environment:
- PF Version: 8.0
- JSF + version: _e.g. Mojarra 2.3.9 (probably irrelevant)
- Affected browsers: tested with FireFox 87, Chromium 89 and Opera 76
Expected behavior
The contents of the overlayPanel should not be covered by any other component like the <p:commandButton>. The button should be “under” the overlayPanel.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to set z-index when clicked with dialog overlays ...
One solution to the above problem is: 1) Use tag to each p-dialog and call moveOnTop on (click) like below:
Read more >Setting z-index on p-dialog overlays - Prime Community Forum
I need to be able to control the z-index for both the overlay and the dialog box that comes along with p-dialog.
Read more >z-index always increase for background mask #1907 - GitHub
Hi, after some strange behavior on my project, I found that background mask z-index always increase, and override my components.
Read more >How to Use the Z-index to Overlay Elements With CSS
The z-index property is used to position elements one above the other and it's really simple to do! One of the most common...
Read more >OverlayPanel | PrimeFaces JavaScript API Docs
The DOM element that is displayed as an overlay with the appropriate z-index and position . It is usually a child of the...
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
It’s definitely not a (simple) z-index thing. Changing z-index has no effect unless I set the z-index of the problematic button to -1!
It seems the problem is triggered by a combination of various style-attributes. I could work around the problem when I defined the following CSS rules:
Note, that this might have unwanted side-effects. I didn’t test this extensively.
Unfortunately this change was not enough, when the button was disabled. In this case I had to additionally deactivate the opacity:
That’s not what I want, but that was the only way I found to bring the button below the tooltip 😦
To me this really looks like a bug in the HTML rendering engine. But then, it probably wouldn’t be in all/most browsers. Anyway. I think I’ll stop here for now. If somebody has any useful input, you’re more than welcome!
Thanks @matinh . At least we know its fixed in 10.0 😄