-
Notifications
You must be signed in to change notification settings - Fork 449
Add focusin, focusout events to DocumentEventMap/HTMLElementEventMap #369
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
Add focusin, focusout events to DocumentEventMap/HTMLElementEventMap #369
Conversation
inputfiles/browser.webidl.xml
Outdated
@@ -3560,6 +3560,8 @@ | |||
<property name="onended" event-handler="ended" type="EventHandler"/> | |||
<property name="onerror" event-handler="error" type="EventHandler"/> | |||
<property name="onfocus" event-handler="focus" type="EventHandler"/> | |||
<property name="focusin" event-handler="focusin" type="EventHandler"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these files are autogrenerated and we do not manually change them.So we will need to add support for adding even handler maps to the generation script and add them to overridingTypes.json instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhegazy thanks, I'll update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mhegazy
I have added following to addedTypes.json
but it doesn't generate anything. Do I have to update somewhere else too? I suspect that it's the double quotes in DocumentEventMap properties. (ex: "blur": FocusEvent;
) but not sure.
{
"kind": "property",
"interface": "DocumentEventMap",
"name": "\"focusin\"",
"type": "FocusEvent"
},
{
"kind": "property",
"interface": "DocumentEventMap",
"name": "\"focusout\"",
"type": "FocusEvent"
}
985b959
to
5bfaaae
Compare
5bfaaae
to
67d58e6
Compare
1aa74e8
to
67d58e6
Compare
Type additions for |
Thanks @saschanaz so do I need to update TS.fsx file to include it? or any other suggestions to fix the issue? |
@saschanaz @mhegazy PR updated. Pls review. |
Why this PR not in master branch still? |
FocusEvents are still not there https://github.com/Microsoft/TSJS-lib-generator/blob/master/src/emitter.ts#L27-L38 |
I also want focusin/focusout because it's inconvenient to keep on writing addEventListener('focusin' as any as keyof HTMLElementEventMap, ...). But HTMLElementEventMap is generated from https://github.com/Microsoft/TSJS-lib-generator which requires that the event be in a W3C candidate recommendation or further, but I could only find focusin in a working draft https://www.w3.org/TR/uievents/#event-type-focusin. I don't know that it will make it based on the current standard for inclusion. |
So guys, which version has the 'focusin' and 'focusout'? |
#696 added them again, so I think the next release will have it. |
Fixes microsoft/TypeScript#21822