fix: properly define focus expose for new task input field
resolves #1993
This commit is contained in:
parent
ae6bda3cf4
commit
e0864fab3e
2 changed files with 9 additions and 1 deletions
|
@ -198,6 +198,14 @@ function handleEnter(e: KeyboardEvent) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
addTask()
|
addTask()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function focusTaskInput() {
|
||||||
|
newTaskInput.value.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
focusTaskInput,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -262,7 +262,7 @@ export default defineComponent({
|
||||||
}, 200)
|
}, 200)
|
||||||
},
|
},
|
||||||
focusNewTaskInput() {
|
focusNewTaskInput() {
|
||||||
this.$refs.addTask.$refs.newTaskInput.focus()
|
this.$refs.addTask.focusTaskInput()
|
||||||
},
|
},
|
||||||
updateTaskList( task ) {
|
updateTaskList( task ) {
|
||||||
if ( this.isAlphabeticalSorting ) {
|
if ( this.isAlphabeticalSorting ) {
|
||||||
|
|
Loading…
Reference in a new issue