Solution 1
Listen to mousedown
instead of click
.
The mousedown
and blur
events occur one after another when you press the mouse button, but click
only occurs when you release it.
Solution 2
You can preventDefault()
in mousedown
to …
Listen to mousedown
instead of click
.
The mousedown
and blur
events occur one after another when you press the mouse button, but click
only occurs when you release it.
You can preventDefault()
in mousedown
to …