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

dispatchEvent returns boolean #5117

Merged
merged 3 commits into from
Feb 15, 2018
Merged

dispatchEvent returns boolean #5117

merged 3 commits into from
Feb 15, 2018

Conversation

aomarks
Copy link
Member

@aomarks aomarks commented Feb 15, 2018

This came up in the TypeScript declarations. Since we extend both Element and TemplateInstanceBase, the signatures on these two interfaces need to be compatible. Element.dispatchEvent returns a boolean, but TemplateInstanceBase.dispatchEvent currently returns void.

I don't really understand how this implementation of dispatchEvent is supposed to work and when it is called, so is it ok to always return true (meaning preventDefault() was not called) as I have done here?

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent

@TimvdLippe
Copy link
Contributor

Hm, previously it would return undefined, which is falsy. Maybe the intention was to block events from bubbling up? Kevin or Steve probably know best.

@sorvell
Copy link
Contributor

sorvell commented Feb 15, 2018

My understanding is this was only added as a stub to prevent errors so I think this is fine.

@aomarks aomarks merged commit 9d86135 into master Feb 15, 2018
@aomarks aomarks deleted the dispatch-event-boolean branch February 15, 2018 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants