-
Notifications
You must be signed in to change notification settings - Fork 41
paper-dialog appears behind backdrop when inside a <app-header-layout> #152
Comments
In #7, there was a workaround that globally moved all |
Unfortunately we can't fix this problem with the current overlay system, here more details on why. The best solution you have is to declare dialogs in the right stacking context. If you can afford loosing style encapsulation, you can reparent the dialogs to |
Are you saying it is not possible to have any dialogs with backdrop in an app layout? In fact, I do have local styles that I want to preserve. Are there other workarounds? |
@simonfuhrmann you can use |
@web-padawan, thanks, in fact, not using |
@simonfuhrmann the issue is not with Unfortunately there's no silver bullet so far. The safest option is to declare the dialog in |
@valdrinkoshi, I understand. But I can't declare the dialog in the body, because of how the app is structured (i.e., the dialog is defined in a deeply nested element). I also cannot move the dialog using Although this may not be an issue of |
I just became aware of a workaround released by IswPolymerElements called I have not used it yet, so I can not vouch for it. But the demo looks encouraging. Edit: I tried |
@maria-le any dialog using The only exception known to me is |
@maria-le Can you provide some feedback about the problem you ran into? Edit: The idea of the Remote and Dialog are communicating via events on |
any progress on this issue :( |
@jukbot , to workaround this you could try adding a function that will move dialog's backdrop before dialog itself, like so:
This has to be fired on
|
The problem with this workaround is that when you fire events from your dialog they will end up in different place than someone might expect I believe? |
+1 |
+1, with the entire goal of webcomponents being isolated and relatively loosely coupled components, having to move the dialog outside of the app-header-layout kinda destroys the intent. |
I have just found a (rather complex) work-around that works with (my setup of) app-header-layout/app-header—as-is, without modifications—in most situations. (i.e. every state except scrolled + revealed). In a nutshell: remove the z-index from app-header as long as it's not fully scrolled away, and re-apply once it is. Then work around non-clickable contents using CSS' The only way I've found for getting the visible height involves observing CSS transform, so the actual code gets rather convoluted:
|
In case someone is interested, we recently published a Material theme preview for Vaadin components, so that |
How about overriding app layout elements to make them NOT use shadow dom? Would that solve the issue? Since polymer 2.x this is possible. |
This behaviour seems to (almost) contravene the specifications for Material Design parent-child hierarchical transitions as described here: https://material.io/design/navigation/navigation-transitions.html#hierarchical-transitions. I say almost because I'm not finding anything specifically describing the navigation bar overlay, but I do see many examples of full screen dialog screens. |
Description
When opening a
<paper-dialog>
that is nested inside<app-header-layout>
, its backdrop (e.g., when using attributeswith-backdrop
ormodal
) appears on top of the dialog, rendering the dialog inoperable.The z-index of the dialog and backdrop element are in the correct order.
Defining all dialogs outside of
<app-header-layout>
is generally not possible in more complex UIs. Usually the<app-header-layout>
appears at a top level component, nesting the main app components. If components further down the DOM need to define dialogs, they will basically end up not working.Expected outcome
Backdrop should appear behind the dialog.
Actual outcome
Backdrop appears in front of the dialog. The dialog is inoperable. Clicking anywhere closes the dialog. In
modal
mode, the application is stuck forever as a dialog cannot be closed by clicking on the backdrop.Steps to reproduce
Create an app layout as follows and add dialogs.
Browsers Affected
Only tested on Chrome 59.0.3071.104 (Official Build) (64-bit)
Related issues
#7
The text was updated successfully, but these errors were encountered: