-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prop updateImmediately to FormsyText #103
Add prop updateImmediately to FormsyText #103
Conversation
Updating on every change is slow for text inputs. Need to add some debouncing here. |
@krizka good idea |
Please, look at my gist in comments to #97 |
@krizka Nice, I added debounce for solving performance issue with calling setValue continuously |
We can not call debounce every time we want to change, but have to get a function from debounce and call it many times. That is why I making setValidate method only once on component mount. |
that why I created if (this.props.updateImmediately) {
if (this.changeValue) {
this.changeValue(event.currentTarget.value);
} else {
this.changeValue = debounce(this.setValue, 200);
this.changeValue(event.currentTarget.value);
}
} |
Oh, sorry, now I got it. Nice job) if (!this.changeValue)
this.changeValue = debounce(this.setValue, 200);
this.changeValue(event.currentTarget.value); |
great, thank you for you feedback |
Please check out #109. |
I added prop
updateImmediately
toFormsyText
in case someone want to get status valid or invalid of textbox immediately when user fill in.Usage