Skip to content

Commit

Permalink
fix(textbox): pasting should not clear undo/redo history
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed May 20, 2024
1 parent 057b269 commit e7dccd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ public void PasteFromClipboard()
#if __SKIA__
try
{
_clearHistoryOnTextChanged = false;
_suppressCurrentlyTyping = true;
#else
{
Expand All @@ -1258,6 +1258,7 @@ public void PasteFromClipboard()
finally
{
_suppressCurrentlyTyping = false;
_clearHistoryOnTextChanged = true;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public partial class TextBox
private string _textWhenTypingStarted;

private int _historyIndex;
private List<HistoryRecord> _history = new(); // the selection of an action is what was selected right before it happened. Might turn out to be unnecessary.
private readonly List<HistoryRecord> _history = new(); // the selection of an action is what was selected right before it happened. Might turn out to be unnecessary.

private (int start, int length, bool tripleTap)? _multiTapChunk;
private (int hashCode, List<(int start, int length)> chunks) _cachedChunks = (-1, new());
Expand Down

0 comments on commit e7dccd2

Please sign in to comment.