Skip to content

Commit 5b98f81

Browse files
authored
Merge pull request #668 from PruthviPraj00/main
Append to existing className instead of overwriting
2 parents 069c821 + 8a5fd3d commit 5b98f81

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/plugins/combobox/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,14 @@ class HSComboBox extends HSBasePlugin<IComboBoxOptions> implements IComboBox {
618618
el.getAttribute("data-hs-combo-box-output-item-attr"),
619619
);
620620

621-
attributes.forEach((attr: IComboBoxItemAttr) => {
622-
el.setAttribute(attr.attr, item[attr.valueFrom]);
621+
attributes.forEach((attr: IComboBoxItemAttr) => {
622+
let value: string = item[attr.valueFrom]
623+
624+
if (attr.attr === 'class' && el.className) {
625+
el.className = `${el.className} ${value}`.trim()
626+
} else {
627+
el.setAttribute(attr.attr, value)
628+
}
623629
});
624630
});
625631
newItem.setAttribute("tabIndex", `${index}`);

0 commit comments

Comments
 (0)