Skip to content

Commit

Permalink
fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Dec 23, 2021
1 parent f8c7a5d commit 0417808
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap5-tags",
"version": "1.3.2",
"version": "1.3.3",
"description": "Replace select[multiple] with nices badges",
"main": "tags",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ class Tags {
}

/**
* Find if label is already selected
* Find if label is already selected (based on attribute)
* @param {string} text
* @returns {boolean}
*/
Expand Down Expand Up @@ -616,9 +616,9 @@ class Tags {
});
}

// update select
// update select, we need to set attribute for isSelected
if (opt) {
opt.selected = true;
opt.setAttribute("selected", "selected");
} else {
// we need to create a new option
opt = document.createElement("option");
Expand All @@ -628,7 +628,7 @@ class Tags {
for (const [key, value] of Object.entries(data)) {
opt.dataset[key] = value;
}
opt.selected = true;
opt.setAttribute("selected", "selected");
this.selectElement.appendChild(opt);
}

Expand Down
Loading

0 comments on commit 0417808

Please sign in to comment.