Skip to content

Commit

Permalink
fix: add set timeout to ensure latest listening
Browse files Browse the repository at this point in the history
  • Loading branch information
Enes5519 committed Aug 5, 2024
1 parent 7b230b0 commit a6eef59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/input/bl-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ export default class BlInput extends FormControlMixin(LitElement) {
}

private onKeydown = (event: KeyboardEvent): void => {
if (event.code === "Enter" && this.form && event.defaultPrevented === false) {
submit(this.form);
if (event.code === "Enter" && this.form) {
setTimeout(() => {
if (!event.defaultPrevented) {
submit(this.form);
}
});
}
};

Expand Down

0 comments on commit a6eef59

Please sign in to comment.