From 987809396db8fc0e7e865ef4035f42affc0401b4 Mon Sep 17 00:00:00 2001 From: yyh Date: Fri, 30 Jan 2026 18:05:09 +0800 Subject: [PATCH] fix --- web/app/components/base/input/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/input/index.tsx b/web/app/components/base/input/index.tsx index 034f57044c..83b720d948 100644 --- a/web/app/components/base/input/index.tsx +++ b/web/app/components/base/input/index.tsx @@ -54,19 +54,23 @@ const Input = React.forwardRef(({ onChange = noop, onBlur = noop, onKeyDown, + onCompositionStart, + onCompositionEnd, onPressEnter, unit, ...props }, ref) => { const { t } = useTranslation() const isComposingRef = React.useRef(false) - const handleCompositionStart = () => { + const handleCompositionStart: React.CompositionEventHandler = (e) => { isComposingRef.current = true + onCompositionStart?.(e) } - const handleCompositionEnd = () => { + const handleCompositionEnd: React.CompositionEventHandler = (e) => { setTimeout(() => { isComposingRef.current = false }, 50) + onCompositionEnd?.(e) } const handleKeyDown: KeyboardEventHandler = (e) => { if (onPressEnter && e.key === 'Enter' && !e.nativeEvent.isComposing && !isComposingRef.current)