タグの確定時に空白文字を置換する

Closes #414.
This commit is contained in:
مرزم اليَغميصاء 2020-07-23 02:42:42 +09:00 committed by مرزم اليَغميصاء
parent 034a47cd25
commit 978eccd643

View File

@ -41,7 +41,7 @@ export default class TagInput extends Vue {
case 'Enter':
case ' ':
if ((event as any).isComposing !== true) {
this.tags.push(this.buffer.trim());
this.tags.push(this.buffer.trim().replace(/\s+/g, '_'));
this.buffer = '';
}
event.preventDefault();
@ -49,7 +49,7 @@ export default class TagInput extends Vue {
case 'Unidentified':
// ()
if (event.srcElement && (event.srcElement as HTMLInputElement).value.slice(-1) == ' ') {
this.tags.push(this.buffer.trim());
this.tags.push(this.buffer.trim().replace(/\s+/g, '_'));
this.buffer = '';
event.preventDefault();
}