AutoComplete doesn't work with textarea on IE8

4 posts, 0 answers
  1. Edwin
    Edwin avatar
    6 posts
    Member since:
    Jan 2012

    Posted 23 Apr 2012 Link to this post

    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.
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 24 Apr 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Russell de Grove
    Russell de Grove avatar
    3 posts
    Member since:
    Apr 2010

    Posted 27 Jun 2012 Link to this post

    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.
  5. Russell de Grove
    Russell de Grove avatar
    3 posts
    Member since:
    Apr 2010

    Posted 28 Jun 2012 Link to this post

    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;

Back to Top
Kendo UI is VS 2017 Ready