Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 599b07a

Browse files
authored
Update EditorRenderer.cs (#15466)
1 parent 1cec455 commit 599b07a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Xamarin.Forms.Platform.Android/Renderers/EditorRenderer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,17 @@ void UpdateCharacterSpacing()
265265

266266
void UpdateText()
267267
{
268+
if (EditText == null || Element == null)
269+
return;
270+
268271
string newText = Element.UpdateFormsText(Element.Text, Element.TextTransform);
269272

270273
if (EditText.Text == newText)
271274
return;
272275

273276
newText = TrimToMaxLength(newText);
274277
EditText.Text = newText;
275-
EditText.SetSelection(newText.Length);
278+
EditText.SetSelection(EditText.Text.Length);
276279
}
277280

278281
abstract protected void UpdateTextColor();

0 commit comments

Comments
 (0)