- Notifications
You must be signed in to change notification settings - Fork20.6k
Description
Description
It appears that if I trigger ablur
event, immediately after analert()
inside a click event handler, it results in an error:
Uncaught TypeError: saved.slice is not a function
This is happening in jQuery 3.7.1 and 4.0.0-beta. But not in 3.5.1. I wonderif this issue might be related.
Link to test case
The way to reproduce this is quite simple:
$('button').on('click',function(e){alert('Hello');$(this).trigger('blur');})
https://jsbin.com/vuquzepidi/edit?html%2Cjs%2Coutput=
I've found that if I useconsole.log
instead ofalert()
it works just fine. Also if I put the trigger into asetTimeout
it works just fine. Likewise if I change it to trigger afocus
event it works. I did try afocus
before theblur
, wondering if the alert might cause the button to loose focus, but no change, and even if it did, I would have expected an error.
Apologies, I haven't yet dug into the code to see what might be happening - I can see in the debugger thatsaved
istrue
, but I've not looked to see why that is yet.