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

Add ToggleEvent.source #11186

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

josepharhar
Copy link
Contributor

@josepharhar josepharhar commented Apr 2, 2025

This adds a new Element attribute to ToggleEvent called invoker. The ToggleEvent's invoker attribute is set to the element which invoked the element which the ToggleEvent is being fired on. Invokers can be set up as a parameter passed to element.showPopover(), an element with the popovertarget attribute, or an element with the commandfor attribute.

Fixes #9111

(See WHATWG Working Mode: Changes for more details.)


/form-control-infrastructure.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/popover.html ( diff )

This adds a new Element attribute to ToggleEvent called invoker. The
ToggleEvent's invoker attribute is set to the element which invoked the
element which the ToggleEvent is being fired on. Invokers can be set up
as a parameter passed to element.showPopover(), an element with the
popovertarget attribute, or an element with the commandfor attribute.

Fixes whatwg#9111
@domenic
Copy link
Member

domenic commented Apr 3, 2025

I haven't kept up with all the command discussions, but didn't we decide never to use the word "invoker" in the public APIs? (I've been a bit disappointed to see it popping up in documentation given that decision, but that's a separate thing...)

I thought we settled on source in CommandEvent.

@nt1m
Copy link
Member

nt1m commented Apr 3, 2025

source is also what's used for the imperative API: showPopover({source: ...})

@josepharhar josepharhar changed the title Add ToggleEvent.invoker Add ToggleEvent.source Apr 3, 2025
@josepharhar
Copy link
Contributor Author

Thank you both! I renamed it from invoker to source.

@annevk annevk added needs implementer interest Moving the issue forward requires implementers to express interest needs tests Moving the issue forward requires someone to write tests labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs implementer interest Moving the issue forward requires implementers to express interest needs tests Moving the issue forward requires someone to write tests
Development

Successfully merging this pull request may close these issues.

Popover does not know what triggered it
4 participants