From 0290c7a929475e7d851a6c86415aae876e35c853 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 25 Mar 2021 17:26:20 +0800 Subject: [PATCH] Android:fix input set Text,set selection to the last --- .../doric/src/main/java/pub/doric/shader/InputNode.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doric-android/doric/src/main/java/pub/doric/shader/InputNode.java b/doric-android/doric/src/main/java/pub/doric/shader/InputNode.java index 88b33a81..680df674 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/InputNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/InputNode.java @@ -84,7 +84,9 @@ public class InputNode extends ViewNode implements TextWatcher, View.O view.setFilters(newFilters); break; case "text": - view.setText(prop.asString().toString()); + String text = prop.isString() ? prop.asString().toString() : ""; + view.setText(text); + view.setSelection(text.length()); break; case "textSize": view.setTextSize(TypedValue.COMPLEX_UNIT_DIP, prop.asNumber().toFloat());