Skip to content

Commit 0285481

Browse files
committed
fix(Input): the input cannot focus when mouse pressed on the prefix or suffix
1 parent 4a37016 commit 0285481

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/vc-input/BaseInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineComponent({
1212
props: baseInputProps(),
1313
setup(props, { slots, attrs }) {
1414
const containerRef = ref();
15-
const onInputMouseDown: MouseEventHandler = e => {
15+
const onInputClick: MouseEventHandler = e => {
1616
if (containerRef.value?.contains(e.target as Element)) {
1717
const { triggerFocus } = props;
1818
triggerFocus?.();
@@ -104,7 +104,7 @@ export default defineComponent({
104104
class={affixWrapperCls}
105105
style={attrs.style as CSSProperties}
106106
hidden={!hasAddon({ addonAfter, addonBefore }) && hidden}
107-
onMousedown={onInputMouseDown}
107+
onClick={onInputClick}
108108
ref={containerRef}
109109
>
110110
{prefix && <span class={`${prefixCls}-prefix`}>{prefix}</span>}

0 commit comments

Comments
 (0)