File tree Expand file tree Collapse file tree 4 files changed +30
-6
lines changed
ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view
React/Fabric/Mounting/ComponentViews/View Expand file tree Collapse file tree 4 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -614,7 +614,15 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
614
614
[self registerForDraggedTypes: pasteboardTypes];
615
615
}
616
616
}
617
- #endif // macOS]
617
+
618
+ // `tooltip`
619
+ if (oldViewProps.tooltip != newViewProps.tooltip ) {
620
+ if (newViewProps.tooltip .has_value ()) {
621
+ self.toolTip = RCTNSStringFromStringNilIfEmpty (newViewProps.tooltip .value ());
622
+ } else {
623
+ self.toolTip = nil ;
624
+ }
625
+ }
618
626
619
627
_needsInvalidateLayer = _needsInvalidateLayer || needsInvalidateLayer;
620
628
Original file line number Diff line number Diff line change @@ -74,7 +74,16 @@ HostPlatformViewProps::HostPlatformViewProps(
74
74
rawProps,
75
75
" draggedTypes" ,
76
76
sourceProps.draggedTypes,
77
- {})) {};
77
+ {})),
78
+ tooltip(
79
+ ReactNativeFeatureFlags::enableCppPropsIteratorSetter ()
80
+ ? sourceProps.tooltip
81
+ : convertRawProp(
82
+ context,
83
+ rawProps,
84
+ " tooltip" ,
85
+ sourceProps.tooltip,
86
+ {})) {}
78
87
79
88
#define VIEW_EVENT_CASE_MACOS (eventType ) \
80
89
case CONSTEXPR_RAW_PROPS_KEY_HASH (" on" #eventType): { \
@@ -112,6 +121,7 @@ void HostPlatformViewProps::setProp(
112
121
RAW_SET_PROP_SWITCH_CASE_BASIC (keyDownEvents);
113
122
RAW_SET_PROP_SWITCH_CASE_BASIC (keyUpEvents);
114
123
RAW_SET_PROP_SWITCH_CASE_BASIC (draggedTypes);
124
+ RAW_SET_PROP_SWITCH_CASE_BASIC (tooltip);
115
125
}
116
126
}
117
127
Original file line number Diff line number Diff line change 16
16
17
17
#include < react/renderer/components/view/KeyEvent.h>
18
18
19
+ #include < optional>
20
+ #include < string>
21
+
19
22
#include " HostPlatformViewEvents.h"
20
23
21
24
namespace facebook ::react {
@@ -45,5 +48,7 @@ class HostPlatformViewProps : public BaseViewProps {
45
48
std::vector<HandledKey> keyUpEvents{};
46
49
47
50
std::vector<std::string> draggedTypes{};
51
+
52
+ std::optional<std::string> tooltip{};
48
53
};
49
54
} // namespace facebook::react
Original file line number Diff line number Diff line change @@ -127,10 +127,6 @@ const Components: Array<RNTesterModuleInfo> = [
127
127
module : require ( '../examples/TextInput/TextInputExample.ios' ) ,
128
128
category : 'Basic' ,
129
129
} ,
130
- {
131
- key : 'TooltipExample' ,
132
- module : require ( '../examples/Tooltip/TooltipExample' ) ,
133
- } ,
134
130
{
135
131
key : 'TouchableExample' ,
136
132
module : require ( '../examples/Touchable/TouchableExample' ) ,
@@ -186,6 +182,11 @@ const APIs: Array<RNTesterModuleInfo> = ([
186
182
key : 'AccessibilityShowMenu' ,
187
183
module : require ( '../examples/AccessibilityShowMenu/AccessibilityShowMenu' ) ,
188
184
category : 'macOS' ,
185
+ } ,
186
+ {
187
+ key : 'TooltipExample' ,
188
+ module : require ( '../examples/Tooltip/TooltipExample' ) ,
189
+ category : 'macOS' ,
189
190
} , // macOS]
190
191
{
191
192
key : 'AccessibilityExample' ,
You can’t perform that action at this time.
0 commit comments