nexheal-lib 0.0.45 → 0.0.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.
@@ -2846,7 +2846,6 @@ class PaginatedAutocompleteControl {
2846
2846
  optionPatched = new EventEmitter();
2847
2847
  valueBuffer = null;
2848
2848
  popperInstance;
2849
- preventDropdownReopen = false;
2850
2849
  preventClearOnBlur = false;
2851
2850
  onChange = () => { };
2852
2851
  onTouched = () => { };
@@ -2868,10 +2867,6 @@ class PaginatedAutocompleteControl {
2868
2867
  this.subscription.add(this.inputControl.valueChanges
2869
2868
  .pipe(debounceTime(this.searchDebounce), distinctUntilChanged())
2870
2869
  .subscribe((value) => {
2871
- if (this.preventDropdownReopen) {
2872
- this.preventDropdownReopen = false;
2873
- return;
2874
- }
2875
2870
  if (this.readonly || !this.hasFocus)
2876
2871
  return;
2877
2872
  this.loadPage(1, value || "");
@@ -2888,7 +2883,6 @@ class PaginatedAutocompleteControl {
2888
2883
  }
2889
2884
  // CVA
2890
2885
  writeValue(value) {
2891
- this.preventDropdownReopen = true;
2892
2886
  if (value == null) {
2893
2887
  this.valueBuffer = null;
2894
2888
  this.selectedItems = null;
@@ -2906,7 +2900,6 @@ class PaginatedAutocompleteControl {
2906
2900
  if (this._displayedOptions.length > 0) {
2907
2901
  const matchedSuggestion = this._displayedOptions.find((s) => s.id === this.valueBuffer);
2908
2902
  if (matchedSuggestion) {
2909
- this.preventDropdownReopen = true;
2910
2903
  this.inputControl.setValue(matchedSuggestion[this.optionDisplayProperty], { emitEvent: false });
2911
2904
  this.selectedItems = matchedSuggestion;
2912
2905
  this.onChange(matchedSuggestion.id);
@@ -2971,7 +2964,6 @@ class PaginatedAutocompleteControl {
2971
2964
  }
2972
2965
  // selection
2973
2966
  selectSuggestion(suggestion) {
2974
- this.preventDropdownReopen = true;
2975
2967
  this.inputControl.setValue(suggestion[this.optionDisplayProperty], {
2976
2968
  emitEvent: false,
2977
2969
  });
@@ -2987,7 +2979,7 @@ class PaginatedAutocompleteControl {
2987
2979
  // events
2988
2980
  onFocus() {
2989
2981
  this.hasFocus = true;
2990
- if (this.readonly)
2982
+ if (this.readonly || this.isDropdownOpen)
2991
2983
  return;
2992
2984
  this.loadPage(1, this.inputControl.value || "");
2993
2985
  }
@@ -3005,10 +2997,14 @@ class PaginatedAutocompleteControl {
3005
2997
  setTimeout(() => {
3006
2998
  if (this.preventClearOnBlur) {
3007
2999
  this.preventClearOnBlur = false;
3008
- // Keep the dropdown alive for load-more clicks
3009
- if (this.inputElement) {
3000
+ // Refocus only while the dropdown is still open (load more / clear).
3001
+ // After selecting an option the dropdown is closed — don't reopen it.
3002
+ if (this.isDropdownOpen && this.inputElement) {
3010
3003
  this.inputElement.nativeElement.focus();
3011
3004
  }
3005
+ else {
3006
+ this.hasFocus = false;
3007
+ }
3012
3008
  return;
3013
3009
  }
3014
3010
  this.hasFocus = false;