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

Fix InlineUIContainer focus #14590

Merged
merged 4 commits into from Feb 14, 2024

Conversation

Gillibald
Copy link
Contributor

@Gillibald Gillibald commented Feb 12, 2024

What does the pull request do?

It changes the visual tree management of InlineUIContainers.

What is the current behavior?

Previously, embedded controls were added to the visual tree in the MeasureOverride but this also required resetting the visual tree. This in the end caused the embedded control to lose focus.

What is the updated/expected behavior with this PR?

The embedded control retains focus for multiple measure calls.

How was the solution implemented (if it's not obvious)?

The InlinesCollection now adds visual children on add/remove to the IInlinesHost. So everything is in sync all the time.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes: #14557

@Gillibald Gillibald changed the title Fixes/inline UI container Fix InlineUIContainer focus Feb 12, 2024
@avaloniaui-bot
Copy link

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

@maxkatz6
Copy link
Member

@Gillibald backport?

@maxkatz6 maxkatz6 added this pull request to the merge queue Feb 14, 2024
Merged via the queue into AvaloniaUI:master with commit 0c2c3f1 Feb 14, 2024
5 checks passed
@Gillibald Gillibald added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Feb 14, 2024
danwalmsley pushed a commit that referenced this pull request Feb 20, 2024
* Fix TextBlock MeasureOverride visual child handling

* Make sure InlineUIContainer's child retains focus on measure

* Resolve merge error
# Conflicts:
#	src/Avalonia.Controls/TextBlock.cs
grokys added a commit that referenced this pull request Feb 20, 2024
* Fix TextBlock MeasureOverride visual child handling

* Make sure InlineUIContainer's child retains focus on measure

* Resolve merge error
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Feb 20, 2024
maxkatz6 pushed a commit that referenced this pull request Feb 20, 2024
* Fix TextBlock MeasureOverride visual child handling

* Make sure InlineUIContainer's child retains focus on measure

* Resolve merge error
#Conflicts:
#	src/Avalonia.Controls/TextBlock.cs
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.

Crash when a TextBox is embedded as an TextBlock inline
3 participants