Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Ajax combo box issue in ie 11

$
0
0

I am facing an issue with ajax combo box in ie 11, where the intellisense feature is not working.

In the below code which is executed in script resource.axd

var userRange = document.selection.createRange();

undefined value is being returned in ie 11 where as in ie 10 , it is returning the current length of the text in the combo box.

This is leading to failure.

Any suggestions/workarounds would be of great assitance.

I used the latest available ajax components updated using nuget.

Thanks in advance

code:

_getTextSelectionInfo:function (textBox, e) {

var info = new Object();

info.strategy =this._getTextSelectionStrategy();

if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft) {

var userRange = document.selection.createRange();

info.selectionStart = 0;

info.selectionEnd = textBox.value.length;

while (userRange.moveStart('character', -1) != 0) {

info.selectionStart++;

}

while (userRange.moveEnd('character', 1) != 0) {

info.selectionEnd--;

}

}

elseif (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.W3C) {

info.selectionStart = textBox.selectionStart;

info.selectionEnd = textBox.selectionEnd;

}

info.typedCharacter = String.fromCharCode(e.charCode);

info.textBoxValue = textBox.value;

info.selectionPrefix = (info.textBoxValue.length >= info.selectionStart)

? info.textBoxValue.substring(0, info.selectionStart)

:'';

info.selectionText = (info.textBoxValue.length >= info.selectionEnd)

? info.textBoxValue.substring(info.selectionStart, info.selectionEnd)

:'';

info.selectionSuffix = (info.textBoxValue.length >= info.selectionEnd)

? info.textBoxValue.substring(info.selectionEnd, info.textBoxValue.length)

:'';

info.selectionTextFirst = info.selectionText.substring(0, 1);

return info;

},


Viewing all articles
Browse latest Browse all 5678

Trending Articles