diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index fb19fd8c32b..f2487f612df 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -368,7 +368,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr * Maximum number of character allows in the input field. * @group Props */ - @Input({ transform: numberAttribute }) maxlength: number | undefined; + @Input({ transform: (value: unknown) => numberAttribute(value, null) }) maxlength: number | undefined; /** * Name of the input element. * @group Props @@ -1078,7 +1078,10 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr clearTimeout(this.searchTimeout); } - let query = event.target.value.split('').slice(0, this.maxlength).join(''); + let query = event.target.value; + if (this.maxlength !== null) { + query = query.split('').slice(0, this.maxlength).join(''); + } if (!this.multiple && !this.forceSelection) { this.updateModel(query); diff --git a/src/app/components/fileupload/fileupload.ts b/src/app/components/fileupload/fileupload.ts index 1fddc8100dc..4ae9bfc4b35 100755 --- a/src/app/components/fileupload/fileupload.ts +++ b/src/app/components/fileupload/fileupload.ts @@ -331,7 +331,7 @@ export class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDe * Maximum number of files that can be uploaded. * @group Props */ - @Input({ transform: numberAttribute }) fileLimit: number | undefined; + @Input({ transform: (value: unknown) => numberAttribute(value, null) }) fileLimit: number | undefined; /** * Style class of the upload button. * @group Props