Skip to content

Commit 5b373a9

Browse files
authored
Merge pull request #365 from ownego/fix/auto-focus-text-field
Fix: auto focus prop in TextField as undefined on false
2 parents 3568201 + d7d5564 commit 5b373a9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/components/TextField/TextField.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ const handleExpandingResize = (heightValue: number) => {
425425
426426
const handleOnFocus = (e: FocusEvent | MouseEvent) => {
427427
focus.value = true;
428-
429428
if (props.selectTextOnFocus && !props.suggestion) {
430429
inputElm.value?.select();
431430
}
@@ -447,7 +446,7 @@ const input = () => h(props.multiline ? 'textarea' : 'input', {
447446
disabled: props.disabled,
448447
readOnly: props.readOnly,
449448
role: props.role,
450-
autoFocus: props.autoFocus,
449+
autoFocus: props.autoFocus ? props.autoFocus : undefined,
451450
value: normalizedValue.value || props.value,
452451
placeholder: props.placeholder,
453452
style: style.value,
@@ -523,7 +522,6 @@ function handleClick(e: MouseEvent) {
523522
) {
524523
return;
525524
}
526-
527525
inputElm.value?.focus();
528526
}
529527

0 commit comments

Comments
 (0)