From 0285481fecb291c27d176c56a158f701c250c540 Mon Sep 17 00:00:00 2001 From: Hitsuki9 <31876031+Hitsuki9@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:33:38 +0800 Subject: [PATCH] fix(Input): the input cannot focus when mouse pressed on the prefix or suffix --- components/vc-input/BaseInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/vc-input/BaseInput.tsx b/components/vc-input/BaseInput.tsx index 729ca6a47d..872acadbb1 100644 --- a/components/vc-input/BaseInput.tsx +++ b/components/vc-input/BaseInput.tsx @@ -12,7 +12,7 @@ export default defineComponent({ props: baseInputProps(), setup(props, { slots, attrs }) { const containerRef = ref(); - const onInputMouseDown: MouseEventHandler = e => { + const onInputClick: MouseEventHandler = e => { if (containerRef.value?.contains(e.target as Element)) { const { triggerFocus } = props; triggerFocus?.(); @@ -104,7 +104,7 @@ export default defineComponent({ class={affixWrapperCls} style={attrs.style as CSSProperties} hidden={!hasAddon({ addonAfter, addonBefore }) && hidden} - onMousedown={onInputMouseDown} + onClick={onInputClick} ref={containerRef} > {prefix && <span class={`${prefixCls}-prefix`}>{prefix}</span>}