-
Notifications
You must be signed in to change notification settings - Fork 379
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
Add global reflecting attributes to ElementInternals? #821
Comments
ElementInternals is for setting internal values. The example code you give doesn't seem to be a use case; I'm unclear what it's saying. Is the author trying to use title, unaware that it's a reflecting setter? Are they trying to set the title attribute, but unaware that you're not supposed to do that in constructors? I think there are clear solutions for either of those use cases (e.g., use a different name, or use connectedCallback, respectively) that don't require new spec and implementation work on ElementInternals. So in general I agree with your last paragraph; the global attributes are generally not internal things (like default ARIA semantics are) and it doesn't make much sense to put them on ElementInternals. |
I think the intent was just to add a tooltip, and the title attribute is the mechanism available. Is that something that should always be done via If that's not the conclusion, then is the correct way to do this to set the title attribute in connectedCallback, or is this the kind of thing where there should also be an internal default, overridable by the public attribute? edit: |
Just adding a tooltip is a misguided way of thinking about |
Since reflecting IDL attributes create HTML attributes on an element when set, and there may be cases where that's undesired, or even disallowed (setting attributes in a constructor) - should some or all of the global attributes have properties added to ElementInternals? And should global attributes going forward be added to ElementInternals?
A use case would be an element that wants to perform some initialize a value in a custom element constructor
This will report an error because the
title
attribute is created. I've seen people hit this withtitle
and recently withariaPressed
in Safari.ariaPressed
will be handled by ElementInternals, so should other attributes be to?Looking at the current list of global attributes, including
title
(but excludingtabindex
, which might be covered differently like in #762) I could possibly see arguments that they're not actually internal and should only be set externally, ie an element shouldn't sprout it's own tooltip, but I'm not sure if or how that's been rationalized yet.The text was updated successfully, but these errors were encountered: