Skip to content

Commit

Permalink
wrong menuitem
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Aug 2, 2024
1 parent d134f2d commit 3617869
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,9 +1440,7 @@ class Tags {
// Handle optgroups
if (suggestion["group"] && suggestion["items"]) {
const newChild = ce("li");
// role must be menuitem when used with menu
// see https://github.com/lekoala/bootstrap5-tags/issues/114
newChild.setAttribute("role", "menuitem");
newChild.setAttribute("role", "presentation");
newChild.dataset.id = "" + groupId;
const newChildSpan = ce("span");
newChild.append(newChildSpan);
Expand Down Expand Up @@ -1493,7 +1491,9 @@ class Tags {
let textContent = this._config.onRenderItem(suggestion, label, this);

const newChild = ce("li");
newChild.setAttribute("role", "presentation");
// role must be menuitem when used with menu
// see https://github.com/lekoala/bootstrap5-tags/issues/114
newChild.setAttribute("role", "menuitem");
if (suggestion.group_id) {
newChild.setAttribute("data-group-id", "" + suggestion.group_id);
}
Expand Down

0 comments on commit 3617869

Please sign in to comment.