From ed45f52433185c37e237ee77b3e62c713864ac70 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 10 Nov 2022 08:06:35 -0500 Subject: [PATCH] update comment --- src/components/input/input.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/input/input.ts b/src/components/input/input.ts index ce5dcbd31..d62de0e29 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -319,8 +319,12 @@ export default class SlInput extends ShoelaceElement { // submitting to allow users to cancel the keydown event if they need to if (event.key === 'Enter' && !hasModifier) { setTimeout(() => { - // isComposing is true when enter key is pressed while choosing the chinese/japanese/etc character - // so this check will prevent form submitting after choosing character by enter key pressing + // + // When using an Input Method Editor (IME), pressing enter will cause the form to submit unexpectedly. One way + // to check for this is to look at event.isComposing, which will be true when the IME is open. + // + // See https://github.com/shoelace-style/shoelace/pull/988 + // if (!event.defaultPrevented && !event.isComposing) { this.formSubmitController.submit(); }