File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,12 +128,10 @@ const registry = {
128128 } ,
129129
130130 orderPatterns ( patterns ) {
131- // XXX: Bit of a hack. We need the validation pattern to be
132- // parsed and initiated before the inject pattern. So we make
133- // sure here, that it appears first. Not sure what would be
134- // the best solution. Perhaps some kind of way to register
135- // patterns "before" or "after" other patterns.
136- if ( patterns . includes ( "validation" ) && patterns . includes ( "inject" ) ) {
131+ // Always add pat-validation as first pattern, so that it can prevent
132+ // other patterns from reacting to submit events if form validation
133+ // fails.
134+ if ( patterns . includes ( "validation" ) ) {
137135 patterns . splice ( patterns . indexOf ( "validation" ) , 1 ) ;
138136 patterns . unshift ( "validation" ) ;
139137 }
You can’t perform that action at this time.
0 commit comments