leobalter / cross-root-aria-delegation

Explainer for the Cross-root ARIA delegation proposal
https://leobalter.github.io/cross-root-aria-delegation/
25 stars 3 forks source link

Imperative ShadowDOM attribute list API #11

Closed Garbee closed 2 years ago

Garbee commented 2 years ago

The imperative declaration seems to clutter the root config space and duplicate the delegates keyword on each one. It seems better to me that delegates (or whatever word is finally chosen) becomes the config key, with a value that is an object of the properties. This would allow the API to be expandable in the future if a non-boolean value is needed for some reason, but reduce overall repetition.

Depending on if we can get support for an all global API (Ref: https://github.com/leobalter/cross-root-aria-delegation/issues/3#issuecomment-1042085811), that could then just be delegates: true to enable that. So the value would either be Boolean | ConfigObject.

For example:

    // current recommendation
    this.attachShadow({ mode: "open", delegatesAriaLabel: true, delegatesAriaDescribedBy: true });

    // Proposed recommendation
    this.attachShadow({ mode: "open", delegates: {ariaLabel: true, ariaDescribedBy: true }});
    // If a global API is ever supported
    this.attachShadow({ mode: "open", delegates: true});
mrego commented 2 years ago

As there are a bunch of similar issues related to syntax, let's discuss them all together at #22.