From dd6e244ffcbc88cbbd5fc5dd9463537e35bb1c9f Mon Sep 17 00:00:00 2001 From: jeremy Pu Date: Thu, 5 May 2022 17:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=BE=97=E7=84=A6=E7=82=B9=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=94=B9=E5=88=B0onMouseDown=20(#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: puchunjie --- src/BaseInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BaseInput.tsx b/src/BaseInput.tsx index 37dfd66..0c6357b 100644 --- a/src/BaseInput.tsx +++ b/src/BaseInput.tsx @@ -29,7 +29,7 @@ const BaseInput: FC = (props) => { const containerRef = useRef(null); - const onInputMouseUp: React.MouseEventHandler = (e) => { + const onInputMouseDown: React.MouseEventHandler = (e) => { if (containerRef.current?.contains(e.target as Element)) { triggerFocus?.(); } @@ -98,7 +98,7 @@ const BaseInput: FC = (props) => { className={affixWrapperCls} style={style} hidden={!hasAddon(props) && hidden} - onMouseUp={onInputMouseUp} + onMouseDown={onInputMouseDown} ref={containerRef} > {prefix && {prefix}}