Skip to content

Commit

Permalink
Fix submit order
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Mar 26, 2024
1 parent d9fca1e commit 72dd520
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/LoginTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ export class LoginTarget extends EventEmitter<LoginTargetEvents> {
* @returns A promise that resolves once submission has been completed
*/
async submit(force: boolean = false): Promise<void> {
if (this.form.tagName.toLowerCase() !== "form" && this.submitButton) {
if (this.submitButton) {
// Click button
this.submitButton.click();
} else if (!this.submitButton) {
} else if (this.form.tagName.toLowerCase() === "form") {
// No button, just try submitting
(this.form as HTMLFormElement).submit();
} else {
Expand Down

0 comments on commit 72dd520

Please sign in to comment.