Skip to content

Commit

Permalink
Fixed #15531 - KeyFilter | No longer working on chips component
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Nov 28, 2024
1 parent d4375c4 commit 17a4a2a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/primeng/src/keyfilter/keyfilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ export class KeyFilter implements Validator {
if (!browser.mozilla && (this.isSpecialKey(e) || !cc)) {
return;
}
let val = this.el.nativeElement.value + cc;
ok = (<RegExp>this.regex).test(val);

let existingValue = this.el.nativeElement.value || '';
let combinedValue = existingValue + cc;

ok = (<RegExp>this.regex).test(combinedValue);

if (!ok) {
e.preventDefault();
Expand Down

0 comments on commit 17a4a2a

Please sign in to comment.