Skip to content

Commit 94b9255

Browse files
committed
DropDownListBox adaptation
1 parent 7bc596d commit 94b9255

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scripts/components/common/dropdownlistbox.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,17 @@ class ListBoxPopup extends ListBox {
5151
mouseMove() {
5252
//#region Variables déclaration
5353
const item = this.itemAtPos(core.mouse.target);
54+
let lastSelectedItem;
5455
//#endregion Variables déclaration
5556
super.mouseMove();
56-
item && !item.selected && (item.selected = !item.selected);
57+
if (item && !item.selected) {
58+
lastSelectedItem = this.items.filter(e => e.selected);
59+
lastSelectedItem && (lastSelectedItem = lastSelectedItem.first);
60+
this.items.beginUpdate();
61+
lastSelectedItem && (lastSelectedItem.selected = !lastSelectedItem.selected);
62+
item.selected = !item.selected;
63+
this.items.endUpdate();
64+
}
5765
}
5866
//#endregion mouseMove
5967
//#endregion Methods

themes/css/carbon/common/listBox.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
.carbon.ListBoxItem.isheader,
17-
.carbon.PopupListBox .carbon.ListBoxItemPopup.isheader {
17+
.carbon.PopupListBox .carbon.ListBoxPopupItem.isheader {
1818
background-color: #F9DDA2;
1919
color: #404040;
2020
font-style: italic;

0 commit comments

Comments
 (0)