-
Notifications
You must be signed in to change notification settings - Fork 27.5k
page reloads when route changed from form submission #1238
Comments
it turns out that since the form directive uses jqLite/jQuery to register the submit event listener, this listener is removed when route change occurs and the dom (including the form) is destroyed before the event propagates to the form element. once the event propagates to the form element, the submit listener is gone and the default is not prevented. |
Vojta mentioned that |
this fix ensures that we prevent the default action on form submission (full page reload) even in cases when the form is being destroyed as a result of the submit event handler (e.g. when route change is triggered). The fix is more complicated than I'd like it to be mainly because we need to ensure that we don't create circular references between js closures and dom elements via DOM event handlers that would then result in a memory leak. Also the differences between IE8, IE9 and normal browsers make testing this ugly. Closes #1238
Just in time! The page running my code based on the Project example with angular 1.0.1 would refresh about 1 in 3 times that the user was redirected via |
@vlad I'm glad that this fixes your issue |
Scenario:
form
directive is not honored.The text was updated successfully, but these errors were encountered: