Skip to content

Commit

Permalink
fix(input): fix input's autofocus not work
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjunjian committed Dec 5, 2024
1 parent 5364e56 commit 8ef2ab1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/renderless/src/input/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ export const renderless = (
api.setShowMoreBtn(true)
on(window, 'resize', api.setShowMoreBtn)
}

if (vm.$attrs.autofocus) {
api.focus()
}
})

onBeforeUnmount(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/tree/src/tree-node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<tiny-input
v-model="action.label"
ref="editInput"
autofocus
:autofocus="true"
clearable
@keyup.enter="saveEdit($event)"
@blur="saveEdit($event)"
Expand Down

0 comments on commit 8ef2ab1

Please sign in to comment.