Skip to content

Commit fcf3016

Browse files
authored
fix(input): fix input's autofocus not work (#2615)
1 parent 5364e56 commit fcf3016

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/renderless/src/input/vue.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@ export const renderless = (
416416
api.setShowMoreBtn(true)
417417
on(window, 'resize', api.setShowMoreBtn)
418418
}
419+
420+
if (vm.$attrs.autofocus) {
421+
api.focus()
422+
}
419423
})
420424

421425
onBeforeUnmount(() => {

packages/vue/src/tree/src/tree-node.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<tiny-input
122122
v-model="action.label"
123123
ref="editInput"
124-
autofocus
124+
:autofocus="true"
125125
clearable
126126
@keyup.enter="saveEdit($event)"
127127
@blur="saveEdit($event)"

0 commit comments

Comments
 (0)