Skip to content

Commit

Permalink
Move role and aria-readonly attributes from render function to bind f…
Browse files Browse the repository at this point in the history
…unction
  • Loading branch information
michalkleiner authored and alexweissman committed Oct 26, 2017
1 parent e1cda22 commit 01d881c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/select2/selection/single.js
Expand Up @@ -16,7 +16,7 @@ define([
$selection.addClass('select2-selection--single');

$selection.html(
'<span class="select2-selection__rendered" role="textbox" aria-readonly="true"></span>' +
'<span class="select2-selection__rendered"></span>' +
'<span class="select2-selection__arrow" role="presentation">' +
'<b role="presentation"></b>' +
'</span>'
Expand All @@ -32,7 +32,10 @@ define([

var id = container.id + '-container';

this.$selection.find('.select2-selection__rendered').attr('id', id);
this.$selection.find('.select2-selection__rendered')
.attr('id', id)
.attr('role', 'textbox')
.attr('aria-readonly', 'true');
this.$selection.attr('aria-labelledby', id);

this.$selection.on('mousedown', function (evt) {
Expand Down

0 comments on commit 01d881c

Please sign in to comment.