diff --git a/src/app/components/keyfilter/keyfilter.ts b/src/app/components/keyfilter/keyfilter.ts index b92f0211641..cd9d2f71d55 100755 --- a/src/app/components/keyfilter/keyfilter.ts +++ b/src/app/components/keyfilter/keyfilter.ts @@ -237,12 +237,20 @@ export class KeyFilter implements Validator { onPaste(e: ClipboardEvent) { const clipboardData = e.clipboardData || (this.document.defaultView).clipboardData.getData('text'); if (clipboardData) { + let pattern = /\{[0-9]+\}/; const pastedText = clipboardData.getData('text'); - for (let char of pastedText.toString()) { - if (!this.regex.test(char)) { + if (pattern.test(this.regex.toString())) { + if (!this.regex.test(pastedText)) { e.preventDefault(); return; } + } else { + for (let char of pastedText.toString()) { + if (!this.regex.test(char)) { + e.preventDefault(); + return; + } + } } } }