We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
点击发送的时候 如何输入框不失去焦点且键盘不消失
The text was updated successfully, but these errors were encountered:
源代码在逻辑上是矛盾的,要更改 RN 的源代码,iOS 可以如下实现,但是代价有点大。 OC 源码中 是在 shouldChangeTextInRange 事件捕获 "\n" 字符串来实现 return key 的,如果_blurOnSubmit 为 true 则捕获
RN
iOS
shouldChangeTextInRange
_blurOnSubmit
源码:https://github.com/facebook/react-native/blob/0e55f5b26dc60d8ce37e49b4766d7e9ec0a57605/Libraries/Text/RCTTextView.m#L349-L380
然后在 textFieldShouldEndEditing 之中,通过 _blurOnSubmit 来是判断键盘是否需要 dismiss,如果 _blurOnSubmit 为 false 则保持 keyBoard
textFieldShouldEndEditing
源码:https://github.com/facebook/react-native/blob/0e55f5b26dc60d8ce37e49b4766d7e9ec0a57605/Libraries/Text/RCTTextField.m#L202-L209
Sorry, something went wrong.
No branches or pull requests
点击发送的时候 如何输入框不失去焦点且键盘不消失
The text was updated successfully, but these errors were encountered: