Coder Social home page Coder Social logo

Comments (1)

plusmancn avatar plusmancn commented on May 17, 2024

源代码在逻辑上是矛盾的,要更改 RN 的源代码,iOS 可以如下实现,但是代价有点大。
OC 源码中 是在 shouldChangeTextInRange 事件捕获 "\n" 字符串来实现 return key 的,如果_blurOnSubmit 为 true 则捕获

源码:https://github.com/facebook/react-native/blob/0e55f5b26dc60d8ce37e49b4766d7e9ec0a57605/Libraries/Text/RCTTextView.m#L349-L380

然后在 textFieldShouldEndEditing 之中,通过 _blurOnSubmit 来是判断键盘是否需要 dismiss,如果 _blurOnSubmit 为 false 则保持 keyBoard

源码:https://github.com/facebook/react-native/blob/0e55f5b26dc60d8ce37e49b4766d7e9ec0a57605/Libraries/Text/RCTTextField.m#L202-L209

from im.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.