pawelczak / EasyAutocomplete

JQuery autocomplete plugin
http://easyautocomplete.com
MIT License
729 stars 244 forks source link

Suggestion add event on blur input #439

Open crisferar opened 4 years ago

crisferar commented 4 years ago

Hello, I think it is interesting to add an event blur in the inputs. Someone like me may have a need to use this event. In my case I have solved it by adding the following lines in the jquery.easy-autocomplete.js code:

/* Events */
onClickEvent: function() {},
onSelectItemEvent: function() {},
onLoadEvent: function() {},
onChooseEvent: function() {},
onKeyEnterEvent: function() {},
onMouseOverEvent: function() {},
onMouseOutEvent: function() {}, 
onShowListEvent: function() {},
onHideListEvent: function() {},
onBlurEvent: function() {} /* New line */
            function bindBlur() {
                $field.blur(function() {

                    config.get("list").onBlurInput(); /* New line */

                    setTimeout(function() { 

                        selectedElement = -1;
                        hideContainer();
                    }, 250);
                });
            }

Congratulations on the great work done with easyautocomplete. Greetings, thanks.