I have a form that has an error message, as shown in the example below:
http://codepen.io/anon/pen/dYWyEM?editors=101
The steps to reproduce the problem are as follows:
After opening the codepen link,
1) Focus in the input field
2) Click submit
3) Since the blur event is triggered first, the error message is first hidden, so the position of the submit button changes. So the click event is not logged at all, and I need another click to submit the form.
Is there a way to send a dispatch event first?
Somehow I need to define a target that fires a blur event. It seems relatedTarget
to allow us to figure out the element that caused the blur event. However, this does not work in Firefox.
Is there a way to define an associated Target in all browsers?
source
share