From a6eef590a658a5f79c2f7c7dfaf43adcbedef33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Mon, 5 Aug 2024 14:02:30 +0300 Subject: [PATCH] fix: add set timeout to ensure latest listening --- src/components/input/bl-input.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/input/bl-input.ts b/src/components/input/bl-input.ts index 8f0725d4..3b814915 100644 --- a/src/components/input/bl-input.ts +++ b/src/components/input/bl-input.ts @@ -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); + } + }); } };