From 379a207d9fa7e2569021044011f7e5cdb7c4eb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 30 Jan 2024 11:06:28 +0300 Subject: [PATCH] Fixed #14595 - Autocomplete | maxlength doesn't work anymore --- src/app/components/autocomplete/autocomplete.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index 88f75376726..28c7e96b392 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -1061,7 +1061,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr clearTimeout(this.searchTimeout); } - let query = event.target.value; + let query = event.target.value.split('').slice(0, this.maxlength).join(''); if (!this.multiple && !this.forceSelection) { this.updateModel(query); @@ -1622,3 +1622,4 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr declarations: [AutoComplete] }) export class AutoCompleteModule {} +