Kendo UI Autocomplete not working as expected

2 posts, 0 answers
  1. Steve
    Steve avatar
    3 posts
    Member since:
    Feb 2012

    Posted 11 Feb 2015 Link to this post

    I have run into an issue with the new version of Kendo UI that throws an exception when an autocomplete text box is manually deleted.  In the old version of Kendo, when you remove the input from the text box, no subsequent call is made to the server to retrieve new data.  The new versions, however, will make a call to the server with an empty string when the input is deleted which causes my application to get an error.  The behavior in the Kendo UI Dojo returns all the values when the input is deleted which seems incorrect.  I would think there would be no drop-down values if there is no input.  You can see the difference in behavior by performing the following:


    Go to http://dojo.telerik.com/AyEfe

    Select Kendo 2014 Q2 from the library drop-down.
    Run
    Type "che" in the input box - you will get a drop-down with the search results
    Manually delete the input using backspace - the drop-down results go away

    Now select Kendo 2014 Q3 SP2 from the library drop-down.
    Run
    Type "che" in the input box - you will get a drop-down with the search results
    Manually delete the input using backspace - the drop-down lists all the values

    I think the Q3 SP2 version has a bug since a blank input should return no drop-down data.  Is this accurate or is this by design?  Should I log a bug for this issue?
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 13 Feb 2015 Link to this post

    Hello,

    Indeed we introduced a change in the AutoComplete behavior that is related to #241.  We decided to implement it because it was quite desired feature and this behavior is consistent with the ComboBox widget.
    I completely understand that such change might conflict with your application logic so I would suggest the following workaround:
    Subscribe for the AutoComplete filtering event and stop the filtering if the input is empty string:
    //code
    function onFiltering(e) {
        if (!e.filter.value) {
            e.preventDefault();
        }
    }



    Regards,
    Boyan Dimitrov
    Telerik
     
    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
Back to Top