In contrast to issue #21822, focusin and focusout are missing as event types for element.addEventListener().
TypeScript Version: 3.3.4000
Search Terms:
focusin focusout
Code


Expected behavior:
Both, focusin and focusout, should be available, taking an FocusEvent as their parameter.
Actual behavior:
Both, focusin and focusout, are unknown to TypeScript.
Related Issues:
Hi! Yep, it seems they are missing!
I can contribute to this one, will submit a PR soon.
Should onfocusin and onfocusout be also included as properties of the interface GlobalEventHandlers? e.g.:
onfocusin: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
onfocusout: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
Created a PR, still kind of WIP, so I'd be glad to get some feedback!
Just for information here, the PR should be good to be merged now.
@RyanCavanaugh sorry to nag again, but the PR has been open for a month and it's approved, but not yet merged. Is something still missing?
@Fabianopb : Just out of curiosity: In the PR @saschanaz writes: "those IDL attributes are not implemented in any browsers nor included in any spec."
But, in fact ...
Have I been missing something?
And, most importantly, are these two events now added to the lib?
@SetTrend By "those IDL attributes" I meant on* IDL attributes including onfocusin and onfocusout. They are not in the spec nor implemented anywhere, although I filed https://github.com/whatwg/html/issues/4542 to add them.
Yes, @saschanaz is right. But anyway focusin and focusout are now added and merged to master, I dunno when the patch will be released though.
Ah, great! Thanks for clarifying!
Most helpful comment
Ah, great! Thanks for clarifying!