Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[RMmobile] Add Enter.key detection to the Title block #13500
This PR adds Enter.key handling to Title block, and gives the ability to add a new block after it.
This PR set multiline=false, and detect the Enter.key with the default onSubmitEditing prop given by the underlying RN component. It adds a new default empty block after the current. (Default logic on the web).
onSubmitEditing is a very reliable way of detecting Enter.key on TextInput with multiline = false, and works on both HW and SW keyboard without the necessity of implementing hacks with TextWatchers and keyListeners - https://facebook.github.io/react-native/docs/textinput#onsubmitediting
Note: onSubmitEditing does hide the keyboard at the moment, it's a default behavior (at least) on Android. We may need to migrate the Title to RichText if there is no way to circumnavigate this problem.
Note 2: At the moment there is not split in place for the title filed. If you tap enter on the middle of the field there is no split yet.
Previous PR here: #13480
This was referenced
Jan 25, 2019
diegoreymendez left a comment
This is working fine, but I believe it would be to our advantage to try and use more of the web code where possible.
As mentioned in the comment I tested copying some of the web code, and it works great.