Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: Typing not allowed in ComboBox until list shown [27350]

$
0
0
Notice if you place the cursor in the TextBox on the http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx page that you cannot type anything until one of the items in the drop down list is selected. This can be corrected by adding __" && this._optionListItems.length == 0"__ to the if statement below "prevent typing when there are no items in the list" on line 834 of the ComboBox.pre.js file:

```
// prevent typing when there are no items in the list
if (this.get_selectedIndex() == -1 && this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDownList && this._optionListItems.length == 0) {
this.get_textBoxControl().value = '';
e.preventDefault();
e.stopPropagation();
return false;
}

```

Comments: Did some more digging on this. I confirmed the original posters solution to this problem. By adding the check for the actual length of the list instead of if anything is selected (or as well), it allows typing. For whatever reason, as opposed to with previous versions, get_selectedIndex()'s function will return a -1. because the hiddenfield that is used to hold that value is -1 in FF v25 and IE11. This change lets the DropDownStyle of "DropDownList" to work correctly in my limited testing. This change, along with checking to see if the maxLength of the textbox is -1 (which, by web standards is supposed to mean unlimited length), will let this control work as intended. Now how to go about actually submitting my changes for inclusion into the code...I dunno. Most official communication presented in the FAQ's are bouncing.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>