-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Event type
(name string) doesn't get properly checked or suggestions when using addEventListener() on an Union of multiple HTMLElement types
#58497
Comments
for the record: this is not a crash |
@fatcerberus sorry, I didn't have the time to bisect the versions. |
No, I just meant that you put
but itβs not - the compiler didnβt crash. Itβs just not doing what you expect |
I suspect this is just a caveat of #29011, you're calling a union of overloaded and generic methods. Feels like a design limitation to me (just a nosy bystander and not a TS team member) |
@jcalz Thanks for your insights.
I didn't fully understand that post, but I think it's a little different: As @weswigham described, and as I understand, it will at least get an intersected signature (suggestion) between |
These signatures don't merge because the |
This issue has been marked as "Design Limitation" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
π Search Terms
"event type", "addEventListener", "suggestion"
π Version & Regression Information
β― Playground Link
No response
π» Code
π Actual behavior
first one neither complain or suggest when first typing.
π Expected behavior
get suggestions automatically as well as pressing
ctrl+i
like the second one.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: