gd-bs 6.6.80 → 6.6.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.6.80",
3
+ "version": "6.6.81",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -534,13 +534,13 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
534
534
  if (isForm) {
535
535
  // Ensure the selected values match the index
536
536
  let idx = (menu as HTMLSelectElement).selectedIndex;
537
- if (this._items[idx] && this._items[idx].isSelected == false) {
538
- // Parse the items and ensure none are toggled
537
+ if (idx >= 0 && idx < this._items.length) {
538
+ // Parse the items and ensure none are toggled except for the selected index
539
539
  for (let i = 0; i < this._items.length; i++) {
540
540
  // Ensure it's not selected
541
541
  if (this._items[i].isSelected) { this._items[i].toggle(); }
542
542
  // Else, toggle it if it's the selected item
543
- else if (idx == i) { this._items[i].toggle(); }
543
+ else if (idx == i && this._items[i].isSelected == false) { this._items[i].toggle(); }
544
544
  }
545
545
  }
546
546
  }