Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectableTextBlock Selection Issue #15515

Open
xLEGiON opened this issue Apr 25, 2024 · 1 comment · May be fixed by #15536
Open

SelectableTextBlock Selection Issue #15515

xLEGiON opened this issue Apr 25, 2024 · 1 comment · May be fixed by #15536
Labels

Comments

@xLEGiON
Copy link

xLEGiON commented Apr 25, 2024

Describe the bug

The bug described in issue #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 #11294. Specifically, I believe the problem lies in the OnPointerPressed method. The statement here in "SelectableTextBlock.cs" was removed from "TextBox.cs":

if (_wordSelectionStart == -1 || index < SelectionStart || index > SelectionEnd)

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 xLEGiON added the bug label Apr 25, 2024
@timunie
Copy link
Contributor

timunie commented Apr 26, 2024

@xLEGiON as you found a possible fix, maybe you want to file a PR?

@xLEGiON xLEGiON linked a pull request Apr 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants