osl-base-extended 1.1.45 → 1.1.46
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.
|
@@ -1607,11 +1607,20 @@ class OslAutocomplete extends baseComponent {
|
|
|
1607
1607
|
dropdownStyle = {};
|
|
1608
1608
|
filteredItems = [];
|
|
1609
1609
|
touched = false;
|
|
1610
|
+
scrollHandler = () => {
|
|
1611
|
+
if (this._showDropdown) {
|
|
1612
|
+
this._showDropdown = false;
|
|
1613
|
+
this.cdr.markForCheck();
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1610
1616
|
constructor(elRef, cdr) {
|
|
1611
1617
|
super();
|
|
1612
1618
|
this.elRef = elRef;
|
|
1613
1619
|
this.cdr = cdr;
|
|
1614
1620
|
}
|
|
1621
|
+
ngOnDestroy() {
|
|
1622
|
+
document.removeEventListener('scroll', this.scrollHandler, true);
|
|
1623
|
+
}
|
|
1615
1624
|
updateDropdownPosition() {
|
|
1616
1625
|
const wrapper = this.elRef.nativeElement.querySelector('.autocomplete-wrapper');
|
|
1617
1626
|
if (!wrapper)
|
|
@@ -1643,6 +1652,7 @@ class OslAutocomplete extends baseComponent {
|
|
|
1643
1652
|
});
|
|
1644
1653
|
}
|
|
1645
1654
|
ngOnInit() {
|
|
1655
|
+
document.addEventListener('scroll', this.scrollHandler, { capture: true, passive: true });
|
|
1646
1656
|
if (this.searchType === 'Api' && this.methodName && this.service) {
|
|
1647
1657
|
this.placeholder = this.isLister ? 'Type to Search Or Press Enter' : 'Type to Search';
|
|
1648
1658
|
// Fix: [formControl] already updates inputControl on user input, so valueChanges
|