gd-bs 6.6.80 → 6.6.82

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.
@@ -517,15 +517,15 @@ var _Dropdown = /** @class */ (function (_super) {
517
517
  if (isForm) {
518
518
  // Ensure the selected values match the index
519
519
  var idx = menu.selectedIndex;
520
- if (this._items[idx] && this._items[idx].isSelected == false) {
521
- // Parse the items and ensure none are toggled
520
+ if (idx >= 0 && idx < this._items.length) {
521
+ // Parse the items and ensure none are toggled except for the selected index
522
522
  for (var i = 0; i < this._items.length; i++) {
523
523
  // Ensure it's not selected
524
- if (this._items[i].isSelected) {
524
+ if (i != idx && this._items[i].isSelected) {
525
525
  this._items[i].toggle();
526
526
  }
527
527
  // Else, toggle it if it's the selected item
528
- else if (idx == i) {
528
+ else if (idx == i && this._items[i].isSelected == false) {
529
529
  this._items[i].toggle();
530
530
  }
531
531
  }