Skip to content

Commit 7333867

Browse files
authored
fix: call onCancel if label not changed while editing (#232)
1 parent afa534b commit 7333867

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/ToDoItemEditForm.vue

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</div>
2222
</form>
2323
</template>
24+
2425
<script>
2526
export default {
2627
props: {
@@ -42,6 +43,8 @@ export default {
4243
onSubmit() {
4344
if (this.newLabel && this.newLabel !== this.label) {
4445
this.$emit("item-edited", this.newLabel);
46+
} else {
47+
this.onCancel();
4548
}
4649
},
4750
onCancel() {
@@ -54,6 +57,7 @@ export default {
5457
},
5558
};
5659
</script>
60+
5761
<style scoped>
5862
.edit-label {
5963
font-family: Arial, sans-serif;

0 commit comments

Comments
 (0)