betaWeb / inputTags-jQuery-plugin

http://betaweb.github.io/inputTags-jQuery-plugin/
40 stars 19 forks source link

on blur contribution #10

Closed ropic closed 2 years ago

ropic commented 8 years ago

use case: sometimes user only enter one value without hit enter then blur event could be used:

self._blur = function() {
          self.$input.on('blur', function() {
            if(self.$input.val().length > 0){
              e = $.Event('keyup');
              e.keyCode = 13;
              e.which = 13;
              self.$input.trigger(e);
            }
          });
        };

On initialization

self._blur();
ropic commented 8 years ago

maybe it's necessary to tell the users fire the event in case on submit button because blur is not fired

betaWeb commented 8 years ago

Hi @ropic,

Thx for the trick. Maybe you could make a pull request :)