dima-bu / react-time-input

A simple react component for select time in format HH:mm
https://github.com/dima-bu/react-time-input.git#readme
MIT License
54 stars 33 forks source link

Empty value is not valid #14

Open shir opened 7 years ago

shir commented 7 years ago

Looks like if value is empty it's not valid and when value is not valid it's not propagated to onTimeChange. I think it's not correct. There many cases when value may be empty (in my case too).

BTW, there is a lot of checks in isValid function, but in most cases first check will get you false and there is no reasons to continue checking.

hasnat commented 7 years ago

@shir thanks for informing that, I have removed multiple unnecessary checks, altho I agree blank value can be valid at some points, see what @dima-bu has to say about this.

robsonvn commented 7 years ago

I'm facing this problem as well, and the worst thing is that when the component updates the previous value is set back.