From 0aa42b28bc1e0b22298cb45ebf1036b66f25ebf4 Mon Sep 17 00:00:00 2001 From: Marc Labrecque Date: Sat, 1 Nov 2014 19:35:59 -0400 Subject: [PATCH] Add aria-autocomplete to ComboBox and FilteringSelect. Fixes #9089. --- form/ComboBoxMixin.js | 6 +++++ tests/form/_autoComplete.html | 33 ++++++++++++++++++++++++ tests/form/robot/_autoComplete_a11y.html | 21 +++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/form/ComboBoxMixin.js b/form/ComboBoxMixin.js index c841d69ae..5d2e63044 100644 --- a/form/ComboBoxMixin.js +++ b/form/ComboBoxMixin.js @@ -136,6 +136,12 @@ define([ } }); } + }, + + buildRendering: function(){ + this.inherited(arguments); + + this.focusNode.setAttribute("aria-autocomplete", this.autoComplete ? "both" : "list"); } }); }); diff --git a/tests/form/_autoComplete.html b/tests/form/_autoComplete.html index 1eee35e2f..690cb38de 100644 --- a/tests/form/_autoComplete.html +++ b/tests/form/_autoComplete.html @@ -892,5 +892,38 @@

+
+

autoComplete=true

+ + +
+

autoComplete=false

+ diff --git a/tests/form/robot/_autoComplete_a11y.html b/tests/form/robot/_autoComplete_a11y.html index acfd30f7c..3682dddf8 100644 --- a/tests/form/robot/_autoComplete_a11y.html +++ b/tests/form/robot/_autoComplete_a11y.html @@ -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(); });