Skip to content

Commit

Permalink
Add aria-autocomplete to ComboBox and FilteringSelect.
Browse files Browse the repository at this point in the history
Fixes #9089.
  • Loading branch information
mlabrec authored and wkeese committed Dec 5, 2014
1 parent ed4fe78 commit 0aa42b2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
6 changes: 6 additions & 0 deletions form/ComboBoxMixin.js
Expand Up @@ -136,6 +136,12 @@ define([
}
});
}
},

buildRendering: function(){
this.inherited(arguments);

this.focusNode.setAttribute("aria-autocomplete", this.autoComplete ? "both" : "list");
}
});
});
33 changes: 33 additions & 0 deletions tests/form/_autoComplete.html
Expand Up @@ -892,5 +892,38 @@ <h1 class="testTitle" id="title"></h1>

<div id="filteringSelect"></div>

<hr>
<p>autoComplete=true</p>
<select id="autocompleteon" data-dojo-type="$testWidget"
data-dojo-props='name:"autocompleteon",
style:{width:"50%", fontFamily:"Courier"},
autoComplete:true,
selectOnClick:true,
pageSize:5,
title:"New England States"
'>
<option value="ct">Connecticut</option>
<option value="me">Maine</option>
<option value="ma">Massachusetts</option>
<option value="nh">New Hampshire</option>
<option value="vt">Vermont</option>
</select>

<hr>
<p>autoComplete=false</p>
<select id="autocompleteoff" data-dojo-type="$testWidget"
data-dojo-props='name:"autocompleteon",
style:{width:"50%", fontFamily:"Courier"},
autoComplete:false,
selectOnClick:true,
pageSize:5,
title:"New England States"
'>
<option value="ct">Connecticut</option>
<option value="me">Maine</option>
<option value="ma">Massachusetts</option>
<option value="nh">New Hampshire</option>
<option value="vt">Vermont</option>
</select>
</body>
</html>
21 changes: 21 additions & 0 deletions tests/form/robot/_autoComplete_a11y.html
Expand Up @@ -1601,6 +1601,27 @@
}
]);

doh.register("aria-autocomplete (#9089)", [
{
timeout: 1000,
name:"aria-autocomplete with autoComplete enabled",
combo: "autocompleteon",
runTest: function(){
var combo = dijit.byId(this.combo);
doh.is("both", combo.focusNode.getAttribute("aria-autocomplete"), "aria-autocomplete on combo is 'both'");
}
},
{
timeout: 1000,
name:"aria-autocomplete with autoComplete disabled",
combo: "autocompleteoff",
runTest: function(){
var combo = dijit.byId(this.combo);
doh.is("list", combo.focusNode.getAttribute("aria-autocomplete"), "aria-autocomplete on combo is 'list'");
}
}
]);

doh.run();
});
</script>
Expand Down

0 comments on commit 0aa42b2

Please sign in to comment.