Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

iron-overlay-backdrop should append to fitInto element if specified #245

Open
supermario999 opened this issue May 23, 2017 · 3 comments
Open

Comments

@supermario999
Copy link

Description

iron-overlay-backdrop should append to the fitInto element if specified.

Expected outcome

If fitInto is set on an element (for example paper-dialog) then the iron-overlay-backdrop should append to the same fitInto element

Actual outcome

iron-overlay-backdrop is always appended to the body.

Browsers Affected

  • [ x] Chrome
  • [ x] Firefox
  • [ x] Safari 9
  • [ x] Safari 8
  • [ x] Safari 7
  • [ x] Edge
  • [ x] IE 11
  • [ x] IE 10
@valdrinkoshi
Copy link
Member

@supermario999 what would be the use-case & expectations? Should the backdrop also take the size of the fitInto element?
When you set with-backdrop on an overlay, it will also block focus within the overlay (e.g. when you hit TAB the focus will wrap into the overlay).
If you want to only have a backdrop below the overlay, you could do that with css, e.g.

paper-dialog {
  outline: 9999px solid rgba(0, 0, 0, 0.6);
}

@benhjt
Copy link

benhjt commented Jun 22, 2018

I know this is an old issue but I would like to see this option too.

In my use case, we are creating a 'widget' (small app) which is a collection of components which can be included on a clients page. In our case, we would only want the overlay to be appended to our top-most component and have a width and height of 100% of this top-most component rather than be appended to the body.

@juliexiong
Copy link

I would like this option for source order purposes as well.

This is my use-case:

  1. <custom-element-a> is a slot element of <custom-element-b>
  2. <custom-element-a> slots <button> that opens <paper-dialog> on click
  3. Whenever the <paper-dialog> is opened, <iron-overlay-backdrop> is appended to the end of <body>
  4. Since its z-index is much higher than <custom-element-b>, <iron-overlay-backdrop> appears over <paper-dialog>
<custom-element-b>
  <custom-element-a>
    <button>Open dialog</button>
    <paper-dialog></paper-dialog>
  </custom-element-a>
</custom-element-b>
<iron-overlay-backdrop></iron-overlay-backdrop>

Increasing the z-index of <custom-element-b> to be higher will just cause it to cover <iron-overlay-backdrop>.

This is my desired outcome with this issue:

<custom-element-b>
  <custom-element-a>
    <button>Open dialog</button>
    <paper-dialog></paper-dialog>
    <iron-overlay-backdrop></iron-overlay-backdrop>
  </custom-element-a>
</custom-element-b>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants