MOBILE-2201 search-box: Initial search text property

main
Albert Gasset 2019-07-17 16:13:00 +02:00
parent b2db3774e6
commit b5b480e226
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,7 @@ export class CoreSearchBoxComponent implements OnInit {
@Input() lengthCheck = 3; // Check value length before submit. If 0, any string will be submitted. @Input() lengthCheck = 3; // Check value length before submit. If 0, any string will be submitted.
@Input() showClear = true; // Show/hide clear button. @Input() showClear = true; // Show/hide clear button.
@Input() disabled = false; // Disables the input text. @Input() disabled = false; // Disables the input text.
@Input() initialSearch: string; // Initial search text.
@Output() onSubmit: EventEmitter<string>; // Send data when submitting the search form. @Output() onSubmit: EventEmitter<string>; // Send data when submitting the search form.
@Output() onClear: EventEmitter<void>; // Send event when clearing the search form. @Output() onClear: EventEmitter<void>; // Send event when clearing the search form.
@ -55,6 +56,7 @@ export class CoreSearchBoxComponent implements OnInit {
this.placeholder = this.placeholder || this.translate.instant('core.search'); this.placeholder = this.placeholder || this.translate.instant('core.search');
this.spellcheck = this.utils.isTrueOrOne(this.spellcheck); this.spellcheck = this.utils.isTrueOrOne(this.spellcheck);
this.showClear = this.utils.isTrueOrOne(this.showClear); this.showClear = this.utils.isTrueOrOne(this.showClear);
this.searchText = this.initialSearch || '';
} }
/** /**