-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
TypeScript Version: 3.2.4
Search Terms:
event.target instanceof HTMLElement eventTarget not instanceof HTMLElement
Code
// event.target is instanceof HTMLElement
document.querySelector("div").addEventListener("click", (event) => {
// shows error: "EventTarget is missing the following properties from HTMLElement ..."
let t: HTMLElement = event.target;
// Though:
console.log(event.target instanceof HTMLElement) //true
})
Expected behavior:
The interface EventTarget should extend HTMLElement or event.target should return HTMLElement
Actual behavior:
EventTarget is missing the following properties from HTMLElement ...
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code