Changeset 12985

Show
Ignore:
Timestamp:
03/09/08 09:20:01 (9 months ago)
Author:
becky
Message:

fixes #5525 Add ARIA activedescendant support for FF3; mark each option with ARIA option state and assign an id to each option when created. Shorten labels on examples in test_ComboBox.html

Location:
dijit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/form/ComboBox.js

    r12965 r12985  
    405405                                this._isShowingNow=false; 
    406406                                dijit.setWaiState(this.comboNode, "expanded", "false"); 
     407                                dijit.removeWaiState(this.focusNode,"activedescendant"); 
    407408                        } 
    408409                }, 
     
    453454                        // get the text that the user manually entered (cut off autocompleted text) 
    454455                        this.focusNode.value = this.focusNode.value.substring(0, this._getCaretPos(this.focusNode)); 
     456                        //set up ARIA activedescendant 
     457                        dijit.setWaiState(this.focusNode, "activedescendant", dojo.attr(node, "id"));  
    455458                        // autocomplete the rest of the option to announce change 
    456459                        this._autoCompleteText(newValue); 
     
    512515                _startSearch: function(/*String*/ key){ 
    513516                        if(!this._popupWidget){ 
    514                                 var popupId = dojo.attr(this.domNode, "id") + "_popup"; 
     517                                var popupId = this.id + "_popup"; 
    515518                                this._popupWidget = new dijit.form._ComboBoxMenu({ 
    516519                                        onChange: dojo.hitch(this, this._selectOption), 
    517520                                        id:popupId 
    518521                                }); 
    519                                 dijit.setWaiState(this.textbox,"controls",popupId); // associate popup with textbox 
     522                                dijit.removeWaiState(this.focusNode,"activedescendant"); 
     523                                dijit.setWaiState(this.textbox,"owns",popupId); // associate popup with textbox 
    520524                        } 
    521525                        // create a new query to prevent accidentally querying for a hidden 
     
    704708                        var labelObject = labelFunc(item); 
    705709                        var menuitem = dojo.doc.createElement("li"); 
     710                        dijit.setWaiRole(menuitem, "option"); 
    706711                        if(labelObject.html){ 
    707712                                menuitem.innerHTML = labelObject.label; 
     
    724729                        // display "Previous . . ." button 
    725730                        this.previousButton.style.display = (dataObject.start == 0) ? "none" : ""; 
     731                        dojo.attr(this.previousButton, "id", this.id + "_prev"); 
    726732                        // create options using _createOption function defined by parent 
    727733                        // ComboBox (or FilteringSelect) class 
    728734                        // #2309: 
    729735                        //              iterate over cache nondestructively 
    730                         dojo.forEach(results, function(item){ 
     736                        dojo.forEach(results, function(item, i){ 
    731737                                var menuitem = this._createOption(item, labelFunc); 
    732738                                menuitem.className = "dijitMenuItem"; 
     739                                dojo.attr(menuitem, "id", this.id + i); 
    733740                                this.domNode.insertBefore(menuitem, this.nextButton); 
    734741                        }, this); 
    735742                        // display "Next . . ." button 
    736743                        this.nextButton.style.display = (dataObject.count == results.length) ? "" : "none"; 
     744                        dojo.attr(this.nextButton,"id", this.id + "_next") 
    737745                }, 
    738746 
  • dijit/trunk/tests/form/test_ComboBox.html

    r12703 r12985  
    7272 
    7373        <p>ComboBox #1: inlined data, autoComplete=false, default value of Iowa, pageSize=30</p> 
    74         <label for="setvaluetest">US State test 1 (200% Courier font):</label> 
     74        <label for="setvaluetest">US State test 1</label> (200% Courier font): 
    7575        <select id="setvaluetest" 
    7676                        name="state1" 
     
    159159 
    160160        <p>ComboBox #2: url, autoComplete=true:</p> 
    161         <label for="datatest">US State test 2 (8pt font): </label> 
     161        <label for="datatest">US State test 2</label> (8pt font):  
    162162        <input dojoType="dijit.form.ComboBox" 
    163163                        value="California" 
     
    172172        <span>Value: <input id="value2" disabled value="California"></span> 
    173173        <hr> 
    174         <label for="datatestDijit">Dijit List test #1 (150% font): </label> 
     174        <label for="datatestDijit">Dijit List test #1</label> (150% font):  
    175175        <input dojoType="dijit.form.ComboBox" 
    176176                        value="dijit.Editor"