react-native-yusha-customKeyboard
react-native-yusha-customKeyboard copied to clipboard
maxLength属性不起作用
如题!~
不理解maxLength是来控制什么的。。你是指键盘高度吗?
不理解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 [email protected] 写道:
修改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.