-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pat-inject): Don't submit forms with invalid data.
Fix a problem with pat-inject and pat-validation where forms with invalid data could be submitted and the submit button wasn't inactive. The problem was fixed in two ways: - pat-inject now has a check for browser-native form validation. Invalid forms would not be submitted. - pat-inject now waits a tick before it get's initialized. Modern BasePattern based patterns including pat-validation are all deferred for 1 tick by design. pat-inject, being and older Pattern isn't deferred and thus initialized before pat-inject. It's initialized before pat-validation even though we have some Pattern initialization reorganization code in place - pat-inject not being deferred will have it's event handlers always run before any others. But now, with the 1-tick defer in place, pat-inject's event handlers are run in the correct order - after pat-validation form validation which in case of an invalid form would also deactivate the submit button.
- Loading branch information
Showing
6 changed files
with
230 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.