jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

JQuery "change, keydown, keyup" didn't working #100

Open tobidsn opened 6 years ago

tobidsn commented 6 years ago

Why After using data-emojiable="true" in textarea, all change, keydown, keyup, binding data stop to working ?

tobidsn commented 6 years ago

I suppose a (maybe a bit dumb ^^ ) solution would be to i edit script jquery.emojiarea.js line 379

this.$editor.on("change keydown keyup resize scroll", function(e) {
     console.log('Test');    

      if(MAX_LENGTH_ALLOWED_KEYS.indexOf(e.which) == -1 &&
        !((e.ctrlKey || e.metaKey) && e.which == 65) && // Ctrl + A
        !((e.ctrlKey || e.metaKey) && e.which == 67) && // Ctrl + C
        editorDiv.text().length + editorDiv.find('img').length >= editorDiv.attr('maxlength'))
      {
        e.preventDefault();
      }
      self.updateBodyPadding(editorDiv);
    });

But there might be some clever way ^^