fix #303 Infinite loop on datepicker

I believe this fixes the datepicker issue.

:warning: It would be nice to add a couple of unit tests.
Cases like binding both value and invalid text or binding an incorrect value are not properly tested.

And who knows what happens when you have both prefill and invalidText!