Shun Miyazawa 10 месяцев назад
Родитель
Сommit
680aa6ef4b
1 измененных файлов с 4 добавлено и 5 удалено
  1. 4 5
      apps/app/src/client/components/SearchTypeahead.tsx

+ 4 - 5
apps/app/src/client/components/SearchTypeahead.tsx

@@ -147,12 +147,11 @@ const SearchTypeahead: ForwardRefRenderFunction<IFocusable, Props> = (props: Pro
   }, [onChange, onInputChange]);
 
   const keyDownHandler = useCallback((event: KeyboardEvent) => {
-    if (event.nativeEvent.isComposing) {
-      // do nothing while composing
-      return;
-    }
-
     if (event.key === 'Enter') {
+      // do nothing while composing
+      if (event.nativeEvent.isComposing) {
+        return;
+      }
       if (onSubmit != null && input != null && input.length > 0) {
         // schedule to submit with 100ms delay
         timeoutIdRef.current = setTimeout(() => onSubmit(input), DELAY_FOR_SUBMISSION);