Skip to content

Commit

Permalink
Double dash in input field fix - improvements(#20439)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaflo committed Feb 20, 2024
1 parent d6fd5d8 commit 4059c37
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4059c37

Please sign in to comment.