diff --git a/src/Controls/src/Core/Platform/iOS/Extensions/TextExtensions.cs b/src/Controls/src/Core/Platform/iOS/Extensions/TextExtensions.cs index 73f44ac7f853..0c6a97f1044a 100644 --- a/src/Controls/src/Core/Platform/iOS/Extensions/TextExtensions.cs +++ b/src/Controls/src/Core/Platform/iOS/Extensions/TextExtensions.cs @@ -45,13 +45,16 @@ static void UpdateText(this IUITextInput textInput, InputView inputView, bool is // We need this variable because in some cases because of the iOS's // auto correction eg. eg '--' => '—' the actual text in the input might have // a different length that the one that has been set in the control. - var newTextLength = textInput.TextInRange(textRange)?.Length ?? 0; + var newTextLength = !string.IsNullOrWhiteSpace(inputView.Text) ? textInput.TextInRange(textRange)?.Length ?? 0 : 0; var newText = TextTransformUtilites.GetTransformedText( inputView?.Text, textInput.GetSecureTextEntry() ? TextTransform.Default : inputView.TextTransform ); + if (!string.IsNullOrWhiteSpace(oldText)) + newTextLength = newText.Length; + if (oldText != newText) { // Re-calculate the cursor offset position if the text was modified by a Converter.