@sumaris-net/ngx-components 2.6.23-beta4 → 2.6.23-beta6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21338,19 +21338,25 @@ class NamedFilterSelector extends AppForm {
21338
21338
  return super.dirty || this.filterFormDirty;
21339
21339
  }
21340
21340
  ngOnInit() {
21341
+ this.registerAutocompleteField('namedFilter', {
21342
+ suggestFn: (value, filter) => this.dataService.suggest(value, filter),
21343
+ attributes: ['name'],
21344
+ filter: this.getFilter(),
21345
+ ...this.autocompleteConfig
21346
+ });
21341
21347
  this.registerSubscription(this.form.controls.namedFilter.valueChanges.pipe(debounceTime(100), distinctUntilChanged()).subscribe((value) => this.onFilterChanges(value)));
21342
21348
  }
21343
21349
  setEntityName(entityName) {
21344
21350
  if (!entityName || this._entityName === entityName)
21345
21351
  return;
21346
21352
  this._entityName = entityName;
21347
- // add timeout to allow autocompleteConfig to be set
21348
- setTimeout(() => this.registerAutocompleteField('namedFilter', {
21349
- suggestFn: (value, filter) => this.dataService.suggest(value, filter),
21350
- attributes: ['name'],
21351
- filter: { entityName },
21352
- ...this.autocompleteConfig
21353
- }), 100);
21353
+ // Update autocomplete filter
21354
+ this.autocompleteField.filter = this.getFilter();
21355
+ }
21356
+ getFilter() {
21357
+ return {
21358
+ entityName: this.entityName,
21359
+ };
21354
21360
  }
21355
21361
  markForCheck() {
21356
21362
  this.cd.markForCheck();