Skip to content

Instantly share code, notes, and snippets.

@svcavallar
Created March 20, 2017 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svcavallar/65b76ba3fed0e600b34afe9b95b2f808 to your computer and use it in GitHub Desktop.
Save svcavallar/65b76ba3fed0e600b34afe9b95b2f808 to your computer and use it in GitHub Desktop.
How to patch Polymer paper-dialog so appears in-front of its backdrop

This howto is especially for when using a custom modal paper-dialog that is not within the <body> element - for example within a custom page element.

Add the following to your custom element:

// https://github.com/PolymerElements/paper-dialog/issues/7
patchOverlay: function (e) {
  if (e.target.withBackdrop) {
    e.target.parentNode.insertBefore(e.target.backdropElement, e.target);
  }
},

Next, add on-iron-overlay-opened="patchOverlay" to your <paper-dialog> element(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment