@ascentgl/ads-ui 21.125.1 → 21.125.2
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.
|
@@ -4965,6 +4965,25 @@ class AdsSearchDropdownComponent extends AbstractDropdownComponent {
|
|
|
4965
4965
|
*/
|
|
4966
4966
|
super.processOptions(options);
|
|
4967
4967
|
this.allOptions = new Map(this.displayedOptions);
|
|
4968
|
+
/**
|
|
4969
|
+
* Trigger change detection so that the autocomplete panel
|
|
4970
|
+
* picks up the new options in OnPush parent components.
|
|
4971
|
+
* Then open the panel if the input is still focused.
|
|
4972
|
+
*/
|
|
4973
|
+
this.cdr.markForCheck();
|
|
4974
|
+
this.cdr.detectChanges();
|
|
4975
|
+
if (this.displayedOptions.size &&
|
|
4976
|
+
document.activeElement === this.input?.nativeElement &&
|
|
4977
|
+
!this.trigger?.panelOpen) {
|
|
4978
|
+
// Defer panel opening to next microtask to ensure the autocomplete
|
|
4979
|
+
// overlay picks up rendered options after change detection completes
|
|
4980
|
+
// (required when parent uses OnPush change detection).
|
|
4981
|
+
Promise.resolve().then(() => {
|
|
4982
|
+
if (document.activeElement === this.input?.nativeElement && !this.trigger?.panelOpen) {
|
|
4983
|
+
this.trigger?.openPanel();
|
|
4984
|
+
}
|
|
4985
|
+
});
|
|
4986
|
+
}
|
|
4968
4987
|
});
|
|
4969
4988
|
}
|
|
4970
4989
|
/** @ignore */
|