react-native-windows 0.0.0-canary.594 → 0.0.0-canary.596
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Components/Pressable/Pressable.windows.js +0 -20
- package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.cpp +1 -0
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +7 -5
- package/PropertySheets/Generated/PackageVersion.g.props +1 -1
- package/package.json +1 -1
|
@@ -289,22 +289,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
289
289
|
const viewRef = useRef<React.ElementRef<typeof View> | null>(null);
|
|
290
290
|
useImperativeHandle(forwardedRef, () => viewRef.current);
|
|
291
291
|
|
|
292
|
-
// [Windows
|
|
293
|
-
const _onBlur = (event: BlurEvent) => {
|
|
294
|
-
TextInputState.blurInput(viewRef.current);
|
|
295
|
-
if (props.onBlur) {
|
|
296
|
-
props.onBlur(event);
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
const _onFocus = (event: FocusEvent) => {
|
|
301
|
-
TextInputState.focusInput(viewRef.current);
|
|
302
|
-
if (props.onFocus) {
|
|
303
|
-
props.onFocus(event);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
// Windows]
|
|
307
|
-
|
|
308
292
|
const android_rippleConfig = useAndroidRippleForView(android_ripple, viewRef);
|
|
309
293
|
|
|
310
294
|
const [pressed, setPressed] = usePressState(testOnly_pressed === true);
|
|
@@ -418,10 +402,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
418
402
|
<View
|
|
419
403
|
{...restPropsWithDefaults}
|
|
420
404
|
{...eventHandlers}
|
|
421
|
-
// [Windows
|
|
422
|
-
onBlur={_onBlur}
|
|
423
|
-
onFocus={_onFocus}
|
|
424
|
-
// Windows]
|
|
425
405
|
ref={viewRef}
|
|
426
406
|
style={typeof style === 'function' ? style({pressed}) : style}>
|
|
427
407
|
{typeof children === 'function' ? children({pressed}) : children}
|
|
@@ -69,7 +69,7 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
69
69
|
UpdateOptimizedText();
|
|
70
70
|
} else if (wasOptimized) {
|
|
71
71
|
// Remove optimized text and re-construct as Inline tree
|
|
72
|
-
UpdateOptimizedText();
|
|
72
|
+
UpdateOptimizedText(true);
|
|
73
73
|
if (const auto uiManager = GetNativeUIManager(GetViewManager()->GetReactContext()).lock()) {
|
|
74
74
|
for (size_t i = 0; i < m_children.size(); ++i) {
|
|
75
75
|
if (const auto childNode =
|
|
@@ -83,16 +83,17 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
RecalculateTextHighlighters();
|
|
86
|
+
GetViewManager()->MarkDirty(m_tag);
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
void removeAllChildren() override {
|
|
89
90
|
if (m_isTextOptimized) {
|
|
90
|
-
|
|
91
|
-
textBlock.ClearValue(xaml::Controls::TextBlock::TextProperty());
|
|
91
|
+
UpdateOptimizedText();
|
|
92
92
|
} else {
|
|
93
93
|
Super::removeAllChildren();
|
|
94
94
|
}
|
|
95
95
|
RecalculateTextHighlighters();
|
|
96
|
+
GetViewManager()->MarkDirty(m_tag);
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
void RemoveChildAt(int64_t indexToRemove) override {
|
|
@@ -102,9 +103,10 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
102
103
|
Super::RemoveChildAt(indexToRemove);
|
|
103
104
|
}
|
|
104
105
|
RecalculateTextHighlighters();
|
|
106
|
+
GetViewManager()->MarkDirty(m_tag);
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
void UpdateOptimizedText() {
|
|
109
|
+
void UpdateOptimizedText(bool clearOptimizedText = false) {
|
|
108
110
|
if (m_children.size() > 0 && m_isTextOptimized) {
|
|
109
111
|
if (const auto uiManager = GetNativeUIManager(GetViewManager()->GetReactContext()).lock()) {
|
|
110
112
|
winrt::hstring text = L"";
|
|
@@ -117,7 +119,7 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
117
119
|
auto textBlock = this->GetView().as<xaml::Controls::TextBlock>();
|
|
118
120
|
textBlock.Text(text);
|
|
119
121
|
}
|
|
120
|
-
} else {
|
|
122
|
+
} else if (m_isTextOptimized || clearOptimizedText) {
|
|
121
123
|
auto textBlock = this->GetView().as<xaml::Controls::TextBlock>();
|
|
122
124
|
textBlock.ClearValue(xaml::Controls::TextBlock::TextProperty());
|
|
123
125
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.0.0-canary.
|
|
13
|
+
<ReactNativeWindowsVersion>0.0.0-canary.596</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>0</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|