This is a migrated thread and some comments may be shown as answers.

AutoComplete doesn't work with textarea on IE8

3 Answers 178 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Edwin
Top achievements
Rank 1
Edwin asked on 23 Apr 2012, 04:30 PM
AutoComplete works fine with a textarea in Chrome, but in IE8 it fails when it gets to this line in the AutoComplete init():
            element[0].type = "text";

I added a try/catch block around that line, and that makes it work just fine in IE8.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 24 Apr 2012, 09:47 AM
Hello Edwin,

The AutoComplete has been designed to work with an <input> element. Bear in mind that even if you workaround the Javascript error during initialization, you will get another one if you insert a new line and continue typing. The second error is related to the Kendo datasource filtering mechanism and avoiding it will require adding unnecessary complexity to the code, so we will refrain from officially supporting this scenario unless more people request it.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Russell de Grove
Top achievements
Rank 1
answered on 27 Jun 2012, 09:10 PM
I would also like to use auto-complete with textarea.  I came up with a similar workaround (if (element[0].type != "textarea") {) but did not think to try hitting the ENTER key until I read this post.  It does indeed crash the control.
0
Russell de Grove
Top achievements
Rank 1
answered on 28 Jun 2012, 01:46 PM
The following change to the "search" function in kendo.autocomplete.js seems to keep it from crashing on the newline, but the newline is lost if a selection is made.

 

 

if (separator) {

 

word = wordAtCaret(caretPosition(that.element[0]), word, separator);

}

 

 

if (word.length) {

 

word = word.replace(/\r\n|\n/g,

 

'');

 

}

length = word.length;

Tags
AutoComplete
Asked by
Edwin
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Russell de Grove
Top achievements
Rank 1
Share this question
or