Skip to content

Commit c204ed1

Browse files
kubafloCopilot
andcommitted
Use AsSpan for iOS entry truncation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 62d0197 commit c204ed1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Core/src/Handlers/Entry/EntryHandler.iOS.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ bool ShouldChangeCharactersInRanges(UITextField textField, NSValue[] ranges, str
271271
if (VirtualView is not null && !shouldChange && !string.IsNullOrWhiteSpace(replacementString) &&
272272
replacementString.Length >= maxLength)
273273
{
274-
VirtualView.Text = replacementString.Substring(0, maxLength);
274+
VirtualView.Text = replacementString.AsSpan(0, maxLength).ToString();
275275
}
276276

277277
return shouldChange;
@@ -296,4 +296,4 @@ void OnSelectionChanged(object? sender, EventArgs e)
296296
}
297297
}
298298
}
299-
}
299+
}

0 commit comments

Comments
 (0)