r3325 committed - autocomplete: experimental aria attributes

r3325 committed - autocomplete: experimental aria attributes


Revision: 3325
Author: joern.zaefferer
Date: Tue Sep 29 14:04:19 2009
Log: autocomplete: experimental aria attributes
http://code.google.com/p/jquery-ui/source/detail?r=3325
Modified:
/branches/dev/tests/visual/autocomplete/default.html
/branches/dev/ui/jquery.ui.autocomplete.js
=======================================
--- /branches/dev/tests/visual/autocomplete/default.html    Tue Sep 29
13:36:21 2009
+++ /branches/dev/tests/visual/autocomplete/default.html    Tue Sep 29
14:04:19 2009
@@ -49,7 +49,7 @@
<body>
<div class="ui-widget">
-    <label>Tags: </label>
+    <label for="tags">Tags: </label>
    <input class="ui-widget ui-widget-content ui-corner-all" id="tags" />
</div>
=======================================
--- /branches/dev/ui/jquery.ui.autocomplete.js    Tue Sep 29 13:49:48 2009
+++ /branches/dev/ui/jquery.ui.autocomplete.js    Tue Sep 29 14:04:19 2009
@@ -16,7 +16,10 @@
    _init: function() {
        var self = this;
        // keyup is triggered only once when hold down, keypress multiple times
-        this.element.attr("autocomplete", "off").keypress(function(event) {
+        this.element.attr("autocomplete", "off")
+        // TODO verify these actually work as intended
+    
    .attr("role", "textbox").attr("aria-autocomplete", "list").attr("aria-haspopup", "true")
+        .keypress(function(event) {
            switch(event.keyCode) {
            case $.ui.keyCode.UP:
                self.focusUp();