-
Notifications
You must be signed in to change notification settings - Fork 769
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(iOS): styles resolution #19841
fix(iOS): styles resolution #19841
Conversation
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19841/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19841/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
First of all, the issue reported is happening when within a Reason: When, doing the resource resolution, we had this code: while (candidate is not null)
{
if (candidate is FrameworkElement fe)
{
if (fe.TryGetResources() is { IsEmpty: false }) // It's legal (if pointless) on UWP to set Resources to null from user code, so check
{
yield return fe.Resources;
}
candidate = fe.Parent as FrameworkElement; // [Marked Line] Issue is here
}
else
{
candidate = VisualTreeHelper.GetParent(candidate) as DependencyObject;
}
} On the marked line, we expect the Parent to be a In our case specifically, for the So for the following XAML tree: <Page.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="Red"/>
</Style>
</Page.Resources>
<ScrollViewer>
<ScrollViewer.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="Red"/>
</Style>
</ScrollViewer.Resources>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" utu:SafeArea.Insets="VisibleBounds">
<Button Content="Test Content"/>
</StackPanel>
</ScrollViewer>
</Page> When we reached the point of navigating from the The solution proposed is to remove the casting to |
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19841/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19841/index.html |
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19841/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19841/index.html |
|
b9d3d5a
to
bb5e410
Compare
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19841/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19841/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19841/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19841/index.html |
@Mergifyio backport release/stable/5.6 |
✅ Backports have been created
|
…5.6/pr-19841 fix(iOS): styles resolution (backport #19841)
GitHub Issue (If applicable): closes #19825
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Style resolution only works from immediate parents. Any style at the Page level or above the direct parent is not being recognized.
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):