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

#1869: Dispatch non-jQuery events in @pixiebrix/dom/trigger-event #1880

Merged
merged 1 commit into from
Nov 13, 2021

Conversation

fregante
Copy link
Contributor

@fregante fregante added the bug Something isn't working label Nov 13, 2021
// Trigger a proper MouseEvent on the most common event
element.click();
} else {
element.dispatchEvent(new Event(event, { bubbles: true }));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event that the listener is the exact object created here, while ideally we should dispatch MouseEvent for mouse events, etc.

I took a shortcut here for click instead of mapping all of the events, but let me know if I should do that instead, I'd probably have to parse the DOM events spec to get a full-ish list

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for now. I've created #1884 for follow up

@fregante fregante marked this pull request as ready for review November 13, 2021 15:02
@twschiller twschiller merged commit 7e610ed into main Nov 13, 2021
@twschiller twschiller deleted the F/bug/real-click branch November 13, 2021 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Click event not working on a page elements
2 participants