File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -128,12 +128,10 @@ const registry = {
128
128
} ,
129
129
130
130
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" ) ) {
137
135
patterns . splice ( patterns . indexOf ( "validation" ) , 1 ) ;
138
136
patterns . unshift ( "validation" ) ;
139
137
}
You can’t perform that action at this time.
0 commit comments