I am having a very strange behavior on a farm.
With many text fields in-line verification, if the content is invalid, then there is an error message below the field. Verification stigma has started with.
At the bottom of the page there is a "Next" button, a verification is done and, if everything is okay, the form is submitted.
Now, if the focus is on the empty field, when I click on the button, the following happens:
- OnBlur has been triggered and the in- Line verification is performed
- An error message is displayed
- The rest of the page "error" / li>
- OnClick action is not triggered on this button
I initially thought that onBlur was somehow stopping on onClick. Then I have seen that when the page goes down, the mouse pointer does not remain on the button because it is pushed. If I click on the button in lesser states, such as the "moving" indicator is still on the button, then onClick has been triggered.
I changed onClick with onMouseDown and the problem is fixed, but I'm really surprised by this reason.
onClick
does not trigger because there is no click - one The click is a mousedown
, then there is a mouseup
on the same element if the mouse is not more than the same element, then the browser can not consider clicking one of it - I believe this fails in some cases even when the mouse moves (try a link and move the mouse, see why It is now also follow the link), although less than scrolling with the mouse in my test still it as a click if you scroll back.
From:
A click event occurs when pointing device button is clicked on one element, one click on a single mouse screen in a MouseWave and Mouseview Is defined as.
In your case, while the mouse is not running, 'A' element is not being 'click', or if there is only one element inside the mouse, then its body element Is not, and not what was in your mind.
As far as deciding, you have several options:
- Do not scroll the page when the mouse is down - it is almost certainly for the user Confused / stunning, regardless of who they are clicking on
- One click event may not be required, but use it as a mousewood (as you think you are doing now) < / Li>
- Slowly scroll to the new location, perhaps due to delays and an animated scroll So that a quick click is not affected Keep in mind that the button is considered to click the button , allowing the user to capture the mouse and before moving the mouse before release Can change his mind.
No comments:
Post a Comment