Tip: Use the event.isPropagationStopped () method to check whether this method was called for the event. <button type="submit" onclick="event.preventDefault ()">Click</button>. (untested) - clarkf Nov 3, 2010 at 7:47 Add a comment Serve the angular app using ng serve to see the output. I'm using MAC 10.6 and FF 3.5. Other numbers should only increase if the focus is moved outside or back to the window. First, Template-driven form is one of angular form handling, allowing you to do form validation These usengModel and ngModelOptions, local references with hash. So there's no way to selectively run the onBlur code depending on which button the user has clicked. Call an Inline Function in an onClick Event Handler. Open In Dojo. That is the reason why blur gets fired before click. Then it might evaluate it before the button's click, then again after? Examples Live example This example changes the appearance of a document when it loses focus. How can I disable onBlur event if control receiving focus is 'Cancel ... This works from the angular 5 version onwards. @blur before @click only on Safari - Get Help - Vue Forum Note: Not all events are cancelable. So, you need to specify enableModal property to disable the background content. The event.stopPropagation () method stops the bubbling of an event to parent elements, preventing any parent event handlers from being executed. Listen to a blur event on the parent element (in my case it was the menu). Simply set the pointer-events property to. 2. This works from the angular 5 version onwards. The onblur event occurs when an object loses focus. The div also goes away upon clicking a hyperlink located on the div. Angular FormControl focus and blur Event - concretepage 4.The best solution would be something like: 7 1 $('#ShippingGroup').blur(function() 2 { 3 if($(document.activeElement) == $('.ShippingGroupLinkList')) 4 No matter what you do, if the focus changes from one element to another, the first element's blur event will be fired before the second's focus or click. However, regardless of the initialization mode you apply to the widget, you can handle them by using JavaScript. In the handler, give browser time to focus the next element (by using requestAnimationFrame ). In React, the onClick handler allows you to call a function and perform an action when an element is clicked.