Having two discussions in one thread is confusing… ;-)

I guess we could make a custom object, but I’m not sure what the point is. 
AIUI, the purpose of IPopUpHost is to support many levels of popups. Assuming 
we are right that dialog must be attached to <body>, the simplest way to handle 
that is to attach it directly.

However, I just looked around a bit, and it seems like that’s not true. It 
looks like dialog can be attached to pretty much any element. The only caveat 
seems to be in the polyfill that it’s supposed to not be in an element which 
has a stacking context.[1]

What I’m not sure about dialog is whether the position can be relative to an 
element, or it’s always relative to the whole page. Depending on the answer to 
that, it might make sense to allow different IPopUpHosts, or not.

[1]https://github.com/GoogleChrome/dialog-polyfill 
<https://github.com/GoogleChrome/dialog-polyfill>

> On Feb 24, 2017, at 6:04 AM, Alex Harui <aha...@adobe.com> wrote:
> 
> 
> 
> On 2/23/17, 12:12 AM, "Harbs" <harbs.li...@gmail.com> wrote:
> 
>> It could return the body, but the body is not an IPopUpHost and it does
>> not have addElement().
>> 
>> The element of an embedded app will not be the body, so addElement() to
>> that will blow up if it needs to be added to the body.
> 
> This is JavaScript right?  We can do just about anything we want.  I would
> think you can have IPopUpHost return an object that has addElement that
> proxies the calls to body just like any of our other wrapped HTMLElements.
> 
> The advantage of having an abstraction like IPopUpHost is that different
> configurations have a better chance of having dialog work properly by
> offering their own custom place to hang dialogs.
> 
> Of course, I could be wrong...
> -Alex
> 

Reply via email to