Skip to content

Commit

Permalink
Improve role attributes usage
Browse files Browse the repository at this point in the history
-Replaced role="menu" with role="group" to provide better context for assistive technologies.
-Removed role="menuitem" as checkboxes and radio buttons already have appropriate native semantics.
  • Loading branch information
lucascumsille committed Sep 30, 2024
1 parent 4ff1dab commit b63271c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/jquery.multi-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

this.$menu = $(this.settings['menuHTML']);
this.$menu.attr({
'role': 'menu'
'role': 'group'
}).on('keyup.multiselect', function(e){
var key = e.which;
var escapeKey = 27;
Expand Down Expand Up @@ -261,7 +261,6 @@
var $item = $(_this.settings['menuItemHTML'])
.attr({
'for': unique_id,
'role': 'menuitem'
})
.text(' ' + preset.name)
.on('keydown.multiselect', _this.upDown.bind(_this, 'preset'))
Expand Down Expand Up @@ -332,7 +331,6 @@
var $item = $(this.settings['menuItemHTML'])
.attr({
'for': unique_id,
'role': 'menuitem'
})
.on('keydown.multiselect', this.upDown.bind(this, 'menuitem'))
.text(' ' + $option.text());
Expand Down
18 changes: 9 additions & 9 deletions src/jquery.multi-select.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b63271c

Please sign in to comment.