Skip to content

Commit

Permalink
IE8 won't fire the "input" event on textarea, so bind to "propertycha…
Browse files Browse the repository at this point in the history
…nge" to make it work
  • Loading branch information
gil committed Dec 9, 2014
1 parent f0efedd commit b16b6af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jquery.mentionsInput.js
Expand Up @@ -98,10 +98,15 @@
elmInputBox.attr('data-mentions-input', 'true'); //Sets the attribute data-mentions-input to true -> Defines if the text area is already configured
elmInputBox.bind('keydown', onInputBoxKeyDown); //Bind the keydown event to the text area
elmInputBox.bind('keypress', onInputBoxKeyPress); //Bind the keypress event to the text area
elmInputBox.bind('input', onInputBoxInput); //Bind the input event to the text area
elmInputBox.bind('click', onInputBoxClick); //Bind the click event to the text area
elmInputBox.bind('blur', onInputBoxBlur); //Bind the blur event to the text area

if (navigator.userAgent.indexOf("MSIE 8") > -1) {
elmInputBox.bind('propertychange', onInputBoxInput); //IE8 won't fire the input event, so let's bind to the propertychange
} else {
elmInputBox.bind('input', onInputBoxInput); //Bind the input event to the text area
}

// Elastic textareas, grow automatically
if( settings.elastic ) {
elmInputBox.elastic();
Expand Down

0 comments on commit b16b6af

Please sign in to comment.