Skip to content

Commit

Permalink
Accessibility fix
Browse files Browse the repository at this point in the history
Add name attribute to checkboxes. sourceItem.title is used as the name. This stops browser's accessibilty checks from complaining about the checkboxes.
  • Loading branch information
mikaelgu80 committed Jun 9, 2023
1 parent ebb9850 commit 58db912
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comboTreePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
itemHtml += '<span class="comboTreeParentPlus">' + (this.options.collapse || collapse ? '<span class="mdi mdi-chevron-right-circle-outline"></span>' : '<span class="mdi mdi-chevron-down-circle-outline"></span>') + '</span>'; // itemHtml += '<span class="comboTreeParentPlus">' + (this.options.collapse ? '+' : '&minus;') + '</span>';

if (this.options.isMultiple)
itemHtml += '<span data-id="' + sourceItem.id + '" data-selectable="' + isSelectable + '" class="comboTreeItemTitle ' + selectableClass + '">' + (!selectableLastNode && isSelectable ? '<input type="checkbox" />' : '') + sourceItem.title + '</span>';
itemHtml += '<span data-id="' + sourceItem.id + '" data-selectable="' + isSelectable + '" class="comboTreeItemTitle ' + selectableClass + '">' + (!selectableLastNode && isSelectable ? '<input name="' + sourceItem.title + '" type="checkbox" />' : '') + sourceItem.title + '</span>';
else
itemHtml += '<span data-id="' + sourceItem.id + '" data-selectable="' + isSelectable + '" class="comboTreeItemTitle ' + selectableClass + '">' + sourceItem.title + '</span>';

Expand Down

1 comment on commit 58db912

@mikaelgu80
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add name to checkboxes. This way borwser's accessibilty checks don't complain about the checkboxes.

Please sign in to comment.