From 01d881c8ae4245275d2dcfb4590d550a00a42653 Mon Sep 17 00:00:00 2001 From: Michal Kleiner Date: Mon, 24 Apr 2017 17:11:41 +1200 Subject: [PATCH] Move role and aria-readonly attributes from render function to bind function --- src/js/select2/selection/single.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/select2/selection/single.js b/src/js/select2/selection/single.js index d819aa23..5518bea6 100644 --- a/src/js/select2/selection/single.js +++ b/src/js/select2/selection/single.js @@ -16,7 +16,7 @@ define([ $selection.addClass('select2-selection--single'); $selection.html( - '' + + '' + '' + '' + '' @@ -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) {