Browse Source

Fix SelectableTextBlock selection (#18049)

release/11.2.4
leo 2 years ago
committed by Max Katz
parent
commit
c0c016a19f
  1. 2
      src/Avalonia.Controls/SelectableTextBlock.cs

2
src/Avalonia.Controls/SelectableTextBlock.cs

@ -146,7 +146,7 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
public void SelectAll() public void SelectAll()
{ {
var text = Text; var text = HasComplexContent ? Inlines?.Text : Text;
SetCurrentValue(SelectionStartProperty, 0); SetCurrentValue(SelectionStartProperty, 0);
SetCurrentValue(SelectionEndProperty, text?.Length ?? 0); SetCurrentValue(SelectionEndProperty, text?.Length ?? 0);

Loading…
Cancel
Save