Skip to content

Fix SelectableTextBlock selection when text content changes - #21894

Merged
MrJul merged 2 commits into
AvaloniaUI:mainfrom
zrt2399:fix_issue_21893
Aug 3, 2026
Merged

MrJul merged 2 commits into
AvaloniaUI:mainfrom
zrt2399:fix_issue_21893

Conversation

@zrt2399

@zrt2399 zrt2399 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

What does the pull request do?

Updates SelectableTextBlock selection state when its Text property changes or its Inlines collection is modified.

SelectionStart and SelectionEnd are coerced against the updated content, consistent with TextBox and TextPresenter behavior.

Checklist

Fixed issues

Fixes #21893

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0067938-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added bug backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Jul 30, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0067940-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrJul
MrJul added this pull request to the merge queue Jul 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 31, 2026
@MrJul
MrJul added this pull request to the merge queue Aug 3, 2026
Merged via the queue into AvaloniaUI:main with commit e36b803 Aug 3, 2026
11 checks passed
MrJul pushed a commit to MrJul/Avalonia that referenced this pull request Sep 2, 2026
…UI#21894)

* Fix SelectableTextBlock selection when text content changes

* Clean up
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SelectableTextBlock does not update selection when its text content changes

3 participants