Merge pull request #445 from Al-aighumaisa/replace-whitespace-in-tag
タグの確定時に空白文字を置換する
This commit is contained in:
commit
134a11ad51
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user