anein / angular2-trim-directive

the directive trims whitespaces from the end of an input text value.
MIT License
45 stars 26 forks source link

It gives state as invalid for single character #22

Closed AyushG25 closed 6 years ago

jassiwalia001 commented 6 years ago

comment these lines in writeValue function line no. 63 in directive file and your code will be working
//if (!this._value) { // this._value = value; // }

dannoh commented 6 years ago

This is also the cause of the Paste issues as well.

anein commented 6 years ago

And no one makes a PR. =D

dannoh commented 6 years ago

I started to, but frankly I don't have the Angular knowledge. It's not as simple as removing the line, it was put there to stop fields becoming dirty by just tabbing through them. That might be a better bug than the current state mind you. I believe there is also an issue with single characters in the textbox.

anein commented 6 years ago

I understand. That makes me think that E2E tests should be added.