diff --git a/src/components/modal/FaceEditModal.vue b/src/components/modal/FaceEditModal.vue index 1801f4b05..8071ed7e8 100644 --- a/src/components/modal/FaceEditModal.vue +++ b/src/components/modal/FaceEditModal.vue @@ -8,7 +8,7 @@ ({ - input: String(), + rawInput: String(), }), computed: { @@ -66,6 +66,12 @@ export default defineComponent({ canSave() { return this.input && this.name !== this.input && isNaN(Number(this.input)); }, + + input() { + // Prevent leading and trailing spaces in name + // https://github.com/pulsejet/memories/issues/1074 + return this.rawInput.trim(); + }, }, methods: { @@ -75,7 +81,7 @@ export default defineComponent({ return; } - this.input = isNaN(Number(this.name)) ? this.name : String(); + this.rawInput = isNaN(Number(this.name)) ? this.name : String(); this.show = true; },