I have the following jQuery code:
$input.on('keyup', keyUpListener);
$input.on('input', inputListener);
// IE <= 8 fallback for input event.
$input[0].onpropertychange = function() {
if (window.event.propertyName === "value") {
inputListener(window.event);
}
};
$input is a jQuery input[type='text'].
Right now keyUpListener and inputListener are both executed when I type into the input or when I copy and paste something (onpropertychange is not fired because it is an IE only event).
But how can I tell JS to not fire inputListener if keyUpListener is executing and vice-versa?