gd-bs 6.6.79 → 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
|
@@ -534,9 +534,14 @@ 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
|
-
//
|
|
539
|
-
this._items
|
|
537
|
+
if (idx >= 0 && idx < this._items.length) {
|
|
538
|
+
// Parse the items and ensure none are toggled except for the selected index
|
|
539
|
+
for (let i = 0; i < this._items.length; i++) {
|
|
540
|
+
// Ensure it's not selected
|
|
541
|
+
if (this._items[i].isSelected) { this._items[i].toggle(); }
|
|
542
|
+
// Else, toggle it if it's the selected item
|
|
543
|
+
else if (idx == i && this._items[i].isSelected == false) { this._items[i].toggle(); }
|
|
544
|
+
}
|
|
540
545
|
}
|
|
541
546
|
}
|
|
542
547
|
}
|