Skip to content
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

Open
mengerzhuanyong opened this issue Jan 23, 2019 · 5 comments
Open

maxLength属性不起作用 #14

mengerzhuanyong opened this issue Jan 23, 2019 · 5 comments

Comments

@mengerzhuanyong
Copy link

如题!~

@lyxia
Copy link
Owner

lyxia commented Jan 30, 2019

不理解maxLength是来控制什么的。。你是指键盘高度吗?

@mengerzhuanyong
Copy link
Author

不理解maxLength是来控制什么的。。你是指键盘高度吗?

RN里的TextInput不是有个maxLength属性吗,可以限制输入内容的字符串长度

@qubangliuhui
Copy link

同求

@aloneszjl
Copy link

修改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);
  };

@qubangliuhui
Copy link

qubangliuhui commented Mar 18, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants