TypeScript has different interfaces mapping DOM events. (e.g. KeyboardEvent
, MouseEvent
, etc.). We can find them here.
For instance, they are handy in Angular when receiving an event's payload in an event listener.
I have been a bit surprised to be unable to find an interface for the SubmitEvent
which is described here.
Can anyone confirm and explain why? I would expect the TypeScript team to share interfaces for every DOM event.
Safari doesn't seem to have implemented the SubmitEvent. That might be the reason why typescript has not created an interface for it. (I'm speculating.)
The only thing SubmitEvent is bringing to the table is submitter. That's the part that I was missing... I need Safari support, so I need to do a hack. Not just an interface-hack.
If someone has more info why it's not supported in Safari, please tell me.
References: