Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fc967884d5 | ||
|
360a72d639 | ||
|
0938edc995 |
@ -30,6 +30,7 @@
|
||||
:spellcheck="false"
|
||||
@blur="save(($event.target as HTMLInputElement).textContent as string)"
|
||||
@keydown.enter.prevent.stop="($event.target as HTMLInputElement).blur()"
|
||||
@keydown.esc.prevent.stop="cancel($event.target as HTMLInputElement)"
|
||||
>
|
||||
{{ task.title.trim() }}
|
||||
</h1>
|
||||
@ -133,6 +134,11 @@ async function save(title: string) {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function cancel(element: HTMLInputElement) {
|
||||
element.textContent = props.task.title
|
||||
element.blur()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
Reference in New Issue
Block a user