Skip to content

Commit

Permalink
capricorn86#1092@patch: Simplifies SubmitEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrotoff committed Sep 24, 2023
1 parent 413d791 commit fc25486
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/happy-dom/src/event/events/SubmitEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import IHTMLElement from '../../nodes/html-element/IHTMLElement.js';
* An event triggered by form submit buttons.
*/
export default class SubmitEvent extends Event {
public readonly submitter: IHTMLElement;
public readonly submitter: IHTMLElement | null;

/**
* Constructor.
*
* @param type Event type.
* @param [eventInit] Event init.
*/
constructor(type: string, eventInit: ISubmitEventInit = null) {
constructor(type: string, eventInit: ISubmitEventInit = {}) {
super(type, eventInit);

this.submitter = eventInit?.submitter || null;
this.submitter = eventInit.submitter ?? null;
}
}

0 comments on commit fc25486

Please sign in to comment.