Skip to content

Commit

Permalink
[0.69] Fix Color Customization Bug During High Contrast Mode (#10251)
Browse files Browse the repository at this point in the history
* Meerge Package.json

* Promote 0.69 to latest

* Change files

* Fix Change Files

* Backport Text Patch Fix

* Remove Unneeded

* Remove Unneeded
  • Loading branch information
chiaramooney committed Jul 8, 2022
1 parent fc76646 commit b9e66ab
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 6 deletions.
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Enable Blob module with runtime option",
"packageName": "react-native-windows",
"email": "julio.rocha@microsoft.com",
"dependentChangeType": "patch"
}
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Stop using /fp:strict to build yoga.cpp",
"packageName": "react-native-windows",
"email": "hpratt@microsoft.com",
"dependentChangeType": "patch"
}
Expand Up @@ -43,4 +43,4 @@
"node": ">= 14"
},
"private": true
}
}
2 changes: 1 addition & 1 deletion packages/@react-native-windows/tester/package.json
Expand Up @@ -37,4 +37,4 @@
"engines": {
"node": ">= 14"
}
}
}
2 changes: 1 addition & 1 deletion packages/e2e-test-app/package.json
Expand Up @@ -54,4 +54,4 @@
"engines": {
"node": ">= 14"
}
}
}
2 changes: 1 addition & 1 deletion packages/integration-test-app/package.json
Expand Up @@ -52,4 +52,4 @@
"engines": {
"node": ">= 14"
}
}
}
2 changes: 1 addition & 1 deletion packages/playground/package.json
Expand Up @@ -39,4 +39,4 @@
"engines": {
"node": ">= 14"
}
}
}
2 changes: 1 addition & 1 deletion packages/sample-apps/package.json
Expand Up @@ -38,4 +38,4 @@
"engines": {
"node": ">= 14"
}
}
}
7 changes: 7 additions & 0 deletions vnext/Microsoft.ReactNative/Utils/PropertyUtils.h
Expand Up @@ -139,13 +139,20 @@ bool TryUpdateForeground(
const std::string &propertyName,
const winrt::Microsoft::ReactNative::JSValue &propertyValue) {
if (propertyName == "color") {
auto uielement = element.try_as<xaml::UIElement>();
if (IsValidColorValue(propertyValue)) {
const auto brush = BrushFrom(propertyValue);
element.Foreground(brush);
UpdateControlForegroundResourceBrushes(element, brush);
if (uielement) {
uielement.HighContrastAdjustment(xaml::ElementHighContrastAdjustment::None);
}
} else if (propertyValue.IsNull()) {
element.ClearValue(T::ForegroundProperty());
UpdateControlForegroundResourceBrushes(element, nullptr);
if (uielement) {
uielement.HighContrastAdjustment(xaml::ElementHighContrastAdjustment::Application);
}
}

return true;
Expand Down

0 comments on commit b9e66ab

Please sign in to comment.