i-tech-shared-components 1.4.43 → 1.4.44

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.
@@ -2583,7 +2583,12 @@ class SelectWithSearchComponent {
2583
2583
  const backKey = this.config.backEndKey;
2584
2584
  // We can use the same extraction logic for both formats
2585
2585
  const selections = model[backKey] || [];
2586
- this.selectedIds = new Set(selections);
2586
+ if (Array.isArray(selections)) {
2587
+ this.selectedIds = new Set(selections);
2588
+ }
2589
+ else {
2590
+ this.selectedIds = new Set([model[backKey]]);
2591
+ }
2587
2592
  // selectAll will be undefined in the "Simple" version, which evaluates to false
2588
2593
  this.allSelected = model.selectAll || false;
2589
2594
  }
@@ -2659,8 +2664,12 @@ class SelectWithSearchComponent {
2659
2664
  const id = item.__uniqueId;
2660
2665
  if (this.config.mode === 'SINGLE') {
2661
2666
  // Single mode: Clear others and set this one
2662
- this.selectedIds.clear();
2663
- this.selectedIds.add(id);
2667
+ if (this.selectedIds.has(id)) {
2668
+ this.selectedIds.clear();
2669
+ }
2670
+ else {
2671
+ this.selectedIds.add(id);
2672
+ }
2664
2673
  }
2665
2674
  else {
2666
2675
  // Multi mode: Toggle selection