Skip to content
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

[invokers] add a way to list supported commands? #1068

Open
bkardell opened this issue Jul 2, 2024 · 3 comments
Open

[invokers] add a way to list supported commands? #1068

bkardell opened this issue Jul 2, 2024 · 3 comments
Labels

Comments

@bkardell
Copy link
Collaborator

bkardell commented Jul 2, 2024

In the w3c TAG review, there was a closing comment that

We think that this would be more useful if it were possible to get the list of available actions from elements.

#1020 is related - I don't know if we've ever really fully discussed this feedback.

@lukewarlow
Copy link
Collaborator

Thinking on this there's a number of places where there's a getSupportedX() function. So a getSupportedCommands() function could work okay? I don't see a problem with adding it?

@keithamus what would you think about it?

You would have potentially interesting situations such as <div popover> returning ['toggle-popover', 'show-popover'...] but <div> returning nothing?

How contextual should it be? Would a closed dialog support the 'close' action?

I think we probably already have a HTML spec concept for retrieiving if an action is valid in a given context, so perhaps we can somewhat piggy back off that?

@keithamus
Copy link
Collaborator

It seems reasonable I'm just not overly convinced on the use case. It seems to mostly be feature detection for polyfills but I think it's reasonably tenable to implement polyfills without the need for such explicit feature detection APIs.

@rebeccadavidsson
Copy link

If listing available actions is not an option for now, it would be nice to provide a warning in the HTML or the browser when an action is invalid given the context (or just because of a typo)

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

No branches or pull requests

5 participants