inmite / android-validation-komensky

A simple library for validating user input in forms using annotations.
Apache License 2.0
508 stars 78 forks source link

Error indicator not clearing on some situations #13

Closed yakubbaev closed 9 years ago

yakubbaev commented 10 years ago

My environment:

Case A: Have EditText with rule MaxLength(3).

  1. Enter 4 symbols.
  2. Change focus. => Error indicator pops up
  3. Remove one symbol. Now there're 3 symbols on EditText
  4. Change focus Expected result: Error indicator cleared Actual result: Error indicator stays as was.

However, error indicator gets cleared in following case: Case B: E.g have EditText with rule MinLength(2);

  1. Enter 1 symbol
  2. Change focus => Error indicator pops up
  3. Enter another symbol. Now there're 2 symbols on EditText
  4. There's no step 4. No need to change focus. Result: Error indicator cleared as expected.

As I understood, the reason is TextView automatically clears its error indicator when user inputs some text. After more digging into komensky lib, I figured out that you are not handling at all case when validation succeeds on FormValidator.onGlobalFocusChanged method. I would like to hear your thoughts on this issue. Thanks!

tomas-vondracek commented 9 years ago

Well, that's a bug :) It was fixed by #10

Thank you.