-
Notifications
You must be signed in to change notification settings - Fork 30
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
maxLength属性不起作用 #14
Comments
不理解maxLength是来控制什么的。。你是指键盘高度吗? |
RN里的TextInput不是有个maxLength属性吗,可以限制输入内容的字符串长度 |
同求 |
修改customKeyboard.js 里面的_onChangeText @mengerzhuanyong @qubangliuhui _onChangeText = text => {
+ const { maxLength } = this.props;
+ if (maxLength && !!text && text.length > maxLength) {
+ return;
+ }
this.setState({ text });
this.props.onChangeText && this.props.onChangeText(text);
}; |
好的,谢谢
发自我的 iPhone
… 在 2019年3月18日,下午12:01,aloneszjl ***@***.***> 写道:
修改customKeyboard.js 里面的_onChangeText @mengerzhuanyong @qubangliuhui
_onChangeText = text => {
+ const { maxLength } = this.props;
+ if (maxLength && !!text && text.length > maxLength) {
+ return;
+ }
this.setState({ text });
this.props.onChangeText && this.props.onChangeText(text);
};
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如题!~
The text was updated successfully, but these errors were encountered: