Avalonia
Avalonia copied to clipboard
SelectableTextBlock Selection Issue
Describe the bug
The bug described in issue https://github.com/AvaloniaUI/Avalonia/issues/11390 for TextBox
is still present for the SelectableTextBlock
.
To Reproduce
Double click to select a word. Then a single click on that word does not reset the selection.
Expected behavior
The selection should be reset during the single click.
Avalonia version
11.0.10
OS
Windows
Additional context
It was fixed for TextBox
by https://github.com/AvaloniaUI/Avalonia/pull/11294/. Specifically, I believe the problem lies in the OnPointerPressed
method. The statement here in "SelectableTextBlock.cs" was removed from "TextBox.cs":
https://github.com/AvaloniaUI/Avalonia/blob/40c5d346735a251439668600ca21e66bda65d0d4/src/Avalonia.Controls/SelectableTextBlock.cs#L350
That PR contains some other changes to the word selection code that didn't make it through to "SelectableTextBlock.cs". I don't know if any of that is relevant or just refactoring.
@xLEGiON as you found a possible fix, maybe you want to file a PR?