Skip to content

Commit

Permalink
fix: call onCancel if label not changed while editing (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmth authored Jul 9, 2024
1 parent afa534b commit 7333867
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/ToDoItemEditForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</div>
</form>
</template>

<script>
export default {
props: {
Expand All @@ -42,6 +43,8 @@ export default {
onSubmit() {
if (this.newLabel && this.newLabel !== this.label) {
this.$emit("item-edited", this.newLabel);
} else {
this.onCancel();
}
},
onCancel() {
Expand All @@ -54,6 +57,7 @@ export default {
},
};
</script>

<style scoped>
.edit-label {
font-family: Arial, sans-serif;
Expand Down

0 comments on commit 7333867

Please sign in to comment.