Closed as not planned
Description
π Search Terms
"event type", "addEventListener", "suggestion"
π Version & Regression Information
- This is a crash
β― Playground Link
No response
π» Code
type DivOrSpan = HTMLDivElement | HTMLSpanElement
const divOrSpan = document.querySelector<DivOrSpan>(".could-be-div-or-span")!
divOrSpan.addEventListener("typo", () => {}) // neither complain or suggest when first typing
const div = document.querySelector<HTMLDivElement>(".div")!
div.addEventListener("click", () => {}) // doesn't complain either but get suggestions automatically as well as pressing ctrl+i
π 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