summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-04 16:23:43 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-04 16:23:43 +0200
commit6d3ab605b17223f79d94a3bf82d8e4f16101cb1c (patch)
tree2c85f73445b9d85a65b022518fb35cd6059342bc /program
parentf25be2b863ec997dbe49d655db3a5a80a1f17bb7 (diff)
Make autocomplete widget actually work with screen readers
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 9d08a3f75..dd7b51f04 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3439,9 +3439,7 @@ function rcube_webmail()
this.env.recipients_delimiter = this.env.recipients_separator + ' ';
obj.keydown(function(e) { return ref.ksearch_keydown(e, this, props); })
- .attr('autocomplete', 'off')
- .attr('aria-autocomplete', 'list')
- .attr('aria-expanded', 'false');
+ .attr({ 'autocomplete': 'off', 'aria-autocomplete': 'list', 'aria-expanded': 'false', 'role': 'combobox' });
};
this.submit_messageform = function(draft)
@@ -4586,9 +4584,9 @@ function rcube_webmail()
}
if (node) {
- $(node).addClass('selected').removeAttr('aria-selected', 'true');
+ $(node).addClass('selected').attr('aria-selected', 'true');
this.ksearch_selected = node._rcm_id;
- $(this.ksearch_input).attr('aria-activedecendant', 'rcmkSearchItem' + this.ksearch_selected);
+ $(this.ksearch_input).attr('aria-activedescendant', 'rcmkSearchItem' + this.ksearch_selected);
}
};
@@ -4769,17 +4767,18 @@ function rcube_webmail()
}
if (ul.childNodes.length) {
+ // set the right aria-* attributes to the input field
+ $(this.ksearch_input)
+ .attr('aria-haspopup', 'true')
+ .attr('aria-expanded', 'true')
+ .attr('aria-owns', 'rcmKSearchpane');
+
this.ksearch_pane.show();
+
// select the first
if (!this.env.contacts.length) {
this.ksearch_select($('li:first', ul).get(0));
}
-
- // set the right aria-* attributes to the input field
- $(this.ksearch_input)
- .attr('aria-haspopup', 'true')
- .attr('aria-expanded', 'true')
- .attr('aria-owns', 'rcmKSearchpane')
}
if (len)