Skip to content
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

Missing SubmitEvent in auto complete #40811

Closed
MrTA2 opened this issue Sep 28, 2020 · 2 comments
Closed

Missing SubmitEvent in auto complete #40811

MrTA2 opened this issue Sep 28, 2020 · 2 comments
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@MrTA2
Copy link

MrTA2 commented Sep 28, 2020

Search Terms:

SubmitEvent

Code

// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
function form_Submit(e:SubmitEvent):void { ....... }

Expected behavior:

SubmitEvent is recognized as a DOM type

Actual behavior:

It is not

Playground Link:

Related Issues:

This can be solved by adding this to lib.dom.d.ts:

interface SubmitEvent extends Event
{
readonly submitter: HTMLElement;
}
declare var SubmitEvent: {
prototype: SubmitEvent;
new(type: string, eventInitDict?: EventInit): SubmitEvent;
};

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Sep 28, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Sep 28, 2020
@javan
Copy link

javan commented Nov 21, 2020

This can be solved by adding this to lib.dom.d.ts: …

I don't think that solves it completely. The event handler interfaces would need updating from EventSubmitEvent as well:

"submit": Event;
onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null;

Worth noting that SubmitEvent isn't (yet?) implemented in Safari. References:

@TechQuery
Copy link

@MrTA2 this bug has been fixed by microsoft/TypeScript-DOM-lib-generator#1105, you can close it.

@MrTA2 MrTA2 closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
4 participants