Closed eddnav closed 6 years ago
Interesting. Thanks for the report! I'll take a look at it soon.
For your validation example, you'd want to see an option for the top level validate methods to stop a child view's validation when it hits the first failure and then continue on to the next child, correct? That sounds pretty doable.
@eddnav Thanks again for the reports! I've pushed changes to now support a 'fail fast' mode that implements your use case. All views can be processed and rules processing will stop at the first failure.
I also found the issue with rules processing out of order and fixed that, as well as some QOL changes along the way.
Hope this helps!
Works perfectly, thank you so much!
Not sure if this is expected, but I wanted to report it just in case:
When using:
As weird as it sounds, it seems as if rules are evaluated out of order, for example, the following:
With nothing on the field and:
Sometimes would go over the
notBlank
rule and fail on the second, a breakpoint indeed reveals the value oftext
to be""
so why would it pass that first rule? sometimes it would even pass the second one with an empty field as well, crashing the app on the last one.In the end, what I did was this, which seems to work properly:
It has the added benefit of working like
ValidationMethod.BATCH
, but breaking on the first failed rule instead of concatenating all the failed messages, would be nice to have a way to do something like that with the activity, fragment basedvalidate
.