-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Popup] Invoking popups from custom elements with script vs popup attribute #302
Comments
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label. |
In addition to the comments in OP, which I generally agree with, I think the most typical pattern for a custom element to trigger a popup would be for that custom element to contain a button that triggers the popup, rather than the entire custom element being activatable: <my-element>
<template shadowroot=open>
<button togglepopup=foo>Click for popup</button>
<div popup=popup id=foo>I'm a popup</div>
</template>
</my-element> In this case, things work as expected. In the case where the popup lives outside the shadow tree (and/or outside the custom element), then we anyway can't use the I really think that sounds ok. Adding some sort of default behavior for arbitrary custom elements to be activatable, just so they can use |
Any objections to me closing this issue? |
Per no objections, I'm going to close this issue. Thanks! |
In the initial popup proposal, we shared that a
popup
attribute applied to an element could invoke a related<popup>
element. Applicability of thepopup
attribute is currently restricted to a small number of interactive elements:In the spirit of semantic, accessible markup, it is important to restrict which elements can take the
popup
attribute. A user may not expect to trigger a popup by "invoking" a<div>
, so we'd like to avoid encouraging these sorts of patterns.In the discussion, someone brought up that a custom element could be a trigger for a popup, and that the current restrictions felt overly restrictive as a result. The question for devs writing these types of custom elements is: does anything block you from calling
show()
on the popup in script for this custom element, or can script suffice to wire up this interaction?The text was updated successfully, but these errors were encountered: