Changeset 8927

Show
Ignore:
Timestamp:
06/05/07 10:46:39 (19 months ago)
Author:
doughays
Message:

Fixes #3277. Proxy commit for haysmark.
A FilteringSelect? in Firefox with option tags but not value attribute gets its value set to the first option tag.
Added new test in test_FilteringSelect.html with no data at all.

Location:
dijit/trunk
Files:
2 modified

Legend:

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

    r8926 r8927  
    331331                        //this.parentClass.onblur.apply(this, arguments); 
    332332                }, 
    333                  
     333 
    334334                _announceOption: function(/*Node*/ node){ 
    335335                        // summary: 
     
    342342                        this.focusNode.value=newValue; 
    343343                }, 
    344                  
     344 
    345345                _selectOption: function(/*Event*/ evt){ 
    346346                        var tgt = null; 
     
    418418                        var dpClass=dojo.getObject(this.dataProviderClass, false); 
    419419                        // is the store not specified? 
     420                        var data; 
    420421                        if(this.store==null){ 
    421422                                // if user didn't specify either url or data, then assume there are option tags 
     
    424425                                        var opts = this.domNode.getElementsByTagName("option"); 
    425426                                        var ol = opts.length; 
    426                                         var data=[]; 
     427                                        data=[]; 
    427428                                        // go backwards to create the options list 
    428429                                        // have to go backwards because we are removing the option nodes 
     
    448449                        this.parentClass=dojo.getObject(this.declaredClass, false).superclass; 
    449450                        this.parentClass.postCreate.apply(this, arguments); 
     451 
     452                        // if there is no value set and there is an option list, 
     453                        // set the value to the first value to be consistent with native Select 
     454                        if(data&&data.length&&!this.getValue()){ 
     455                                this.setDisplayedValue(data[0][this.searchAttr]); 
     456                        } 
    450457 
    451458                        // convert the arrow image from using style.background-image to the .src property (a11y) 
  • dijit/trunk/tests/form/test_FilteringSelect.html

    r8926 r8927  
    254254        <div>Value: <input id="value8" disabled></div> 
    255255        <hr> 
    256  
     256        <p>FilteringSelect #9: No data</p> 
     257        <p>This FilteringSelect has no options to choose from.  It should still load.</p> 
     258        <select name="state9" dojoType="dijit.form.FilteringSelect" style="width: 300px;" autocomplete="false"> 
     259        </select> 
     260        <br> 
     261        <hr> 
    257262        <input type="submit"> 
    258263</form>