diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index f9fffef51f9..0d486488ac7 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 @@ -1084,7 +1084,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 e86cf4c7e08..22e5d03f4e9 100755 --- a/src/app/components/fileupload/fileupload.ts +++ b/src/app/components/fileupload/fileupload.ts @@ -336,7 +336,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