TextInput: support text value+child Text nodes

Summary:
Fix and simplify `AndroidTextInputShadowNode::getAttributedString` so that it (1) works, and (2) is aligned with the equivalents in the old Java code.

The issue is that we weren't picking up `text` attributes since we're only traversing children and not the TextInput node itself. If a `text` attribute is present it needs to be treated as its own Text node.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18739830

fbshipit-source-id: 4b3bc81dbe8c241c2e06fe5be1f9b50e49132890
This commit is contained in:
Joshua Gross
2019-12-05 13:20:29 -08:00
committed by Facebook Github Bot
parent 7590d9f8f4
commit a09346f129
2 changed files with 40 additions and 33 deletions
@@ -212,6 +212,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
break;
case "setTextAndSelection":
int mostRecentEventCount = args.getInt(0);
reactEditText.setMostRecentEventCount(mostRecentEventCount);
if (mostRecentEventCount != UNSET) {
String text = args.getString(1);