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.
package/package.json
CHANGED
|
@@ -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 (
|
|
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
|
-
if (this._items[i].isSelected) { this._items[i].toggle(); }
|
|
541
|
+
if (i != idx && 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
|
}
|