Skip to content

Commit

Permalink
fix: edit mode not opening for task modal
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Jul 1, 2024
1 parent 4695af0 commit 64b8766
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions frontend/src/components/Modals/TaskModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,24 +205,23 @@ async function updateTask() {
show.value = false
}
onMounted(() => {
_task.value = { ...props.task }
})
function render() {
editMode.value = false
nextTick(() => {
title.value.el.focus()
_task.value = { ...props.task }
if (_task.value.title) {
editMode.value = true
}
})
}
watch(
() => show.value,
(value) => {
if (!value) return
editMode.value = false
nextTick(() => {
title.value.el.focus()
_task.value = { ...props.task }
if (_task.value.title) {
editMode.value = true
}
})
}
)
onMounted(() => render())
watch(show, (value) => {
if (!value) return
render()
})
</script>
<style scoped>
Expand Down

0 comments on commit 64b8766

Please sign in to comment.