jquery-flexdatalist icon indicating copy to clipboard operation
jquery-flexdatalist copied to clipboard

On focus option arrow keys doesn't work on datalist

Open ajajrajguru opened this issue 7 years ago • 5 comments

First of all thanks for your amazing tags library!!!! Found one issue while working with on focus with minLength set to 0. Arrow up and bottom keys seems to not functioning properly on datalist when focus is set to true. Please have a look at it.

ajajrajguru avatar Oct 27 '17 06:10 ajajrajguru

hi i have the same problem

vladk999 avatar Nov 15 '17 06:11 vladk999

unfortunatly i ran into the same problem, hope this will be fixed soon! besides that > thanks for the great library!!!!

worgor avatar Dec 14 '17 20:12 worgor

It seems that this problem was not fixed for long time. I have the same problem. On focus list is shown but when you press arrow down then first item is not selected. List is just refreshed. Someone know some workaround for this problem? Setting minLength to 1 helps but I need to open list immediately on focus.

kjuro avatar Mar 15 '19 07:03 kjuro

I changed showAllResults function to:

/**
 * Show all results if minLength option is 0.
 */
showAllResults: function (event) {
    var val = $alias.val();
    val = $.trim(val);

    if (val === '' && _this.options.get('minLength') === 0 && $('ul.flexdatalist-results').length === 0) { // JK
        _this.data.load(function (data) {
            _this.results.show(data);
        });
    }
},

kjuro avatar Mar 19 '19 15:03 kjuro

Thanks @kjuro! Your solution worked for me

martinzarza avatar Sep 06 '19 20:09 martinzarza