nexheal-lib 0.0.49 → 0.0.50
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.
package/fesm2022/nexheal-lib.mjs
CHANGED
|
@@ -2957,7 +2957,9 @@ class PaginatedAutocompleteControl {
|
|
|
2957
2957
|
loadNextPage() {
|
|
2958
2958
|
if (!this.hasMore || this.isPageLoading)
|
|
2959
2959
|
return;
|
|
2960
|
-
|
|
2960
|
+
// Continue with the search the list was built from — NOT the input text,
|
|
2961
|
+
// which after a selection holds the display name, not the search term.
|
|
2962
|
+
this.loadPage(this.currentPage + 1, this.lastLoadedSearch ?? (this.inputControl.value || ""));
|
|
2961
2963
|
}
|
|
2962
2964
|
onListScroll(event) {
|
|
2963
2965
|
if (this.paginationType !== 'scroll')
|
|
@@ -3085,6 +3087,14 @@ class PaginatedAutocompleteControl {
|
|
|
3085
3087
|
this.isDropdownOpen = false;
|
|
3086
3088
|
this.isPageLoading = false;
|
|
3087
3089
|
const currentValue = this.inputControl.value;
|
|
3090
|
+
// A valid selection stays valid regardless of which page is displayed —
|
|
3091
|
+
// the selected item may not be in the currently loaded page at all.
|
|
3092
|
+
const matchesSelected = this.selectedItems &&
|
|
3093
|
+
String(this.selectedItems[this.optionDisplayProperty]).toLowerCase() ===
|
|
3094
|
+
String(currentValue).toLowerCase();
|
|
3095
|
+
if (matchesSelected) {
|
|
3096
|
+
return;
|
|
3097
|
+
}
|
|
3088
3098
|
const found = this._displayedOptions.find((opt) => String(opt[this.optionDisplayProperty]).toLowerCase() ===
|
|
3089
3099
|
String(currentValue).toLowerCase());
|
|
3090
3100
|
if (!found) {
|