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: Somebody added a check into the code to check the typed (or pasted) text into the input element against the input element's *maxLength*. (line 844 of the latest version as of this comment) Unfortunately, Firefox sets the *maxLength* default to -1, which will essentially delete any initial character entered into the input element. Why Mozilla did this, I have no idea. Why this hasn't been caught since it pretty much cripples one of the 3 major browsers from being able to even USE this control, I have no idea. I recommend adding an additional check at line 844 of ComboBox.pre.js to check either the browser for Firefox or to check if the maxlength is -1 and to act accordingly.

Viewing all articles
Browse latest Browse all 4356

Trending Articles