How to detect changing of a text field when user inserts a text from the clipboard using mouse (trackpad)? 'change', 'keyup', 'click' events are not fired in this case. How it is done on Twiiter?
If no traditional events work, you may have to set up some kind of polling system:
$('input').focus(function(){
setInterval(function(){
if (this.value != $.data(this, 'oldVal')) {
$(this).trigger('change');
}
}, 250);
}).change(function(){
$.data(this, 'oldVal', this.value);
// do your onchange code here
});
Try subscribing to paste event:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With