diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index e67d551c5a8e44..c595e7af5d19d0 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -99,9 +99,11 @@ - (void)updateEventEmitter:(const EventEmitter::Shared &)eventEmitter NSMutableDictionary *defaultAttributes = [_backedTextInputView.defaultTextAttributes mutableCopy]; +#if !TARGET_OS_MACCATALYST RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new]; eventEmitterWrapper.eventEmitter = _eventEmitter; defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper; +#endif _backedTextInputView.defaultTextAttributes = defaultAttributes; } @@ -262,8 +264,10 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) { NSMutableDictionary *defaultAttributes = RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier())); +#if !TARGET_OS_MACCATALYST defaultAttributes[RCTAttributedStringEventEmitterKey] = _backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey]; +#endif _backedTextInputView.defaultTextAttributes = defaultAttributes; } diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm index 17eec1f275bd6a..1e551e4b127b92 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm @@ -403,6 +403,7 @@ void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText) { auto nsAttributedStringFragment = RCTNSAttributedStringFragmentFromFragment(fragment, placeholderImage); +#if !TARGET_OS_MACCATALYST if (fragment.parentShadowView.componentHandle) { RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new]; eventEmitterWrapper.eventEmitter = fragment.parentShadowView.eventEmitter; @@ -413,6 +414,7 @@ void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText) [nsAttributedStringFragment addAttributes:additionalTextAttributes range:NSMakeRange(0, nsAttributedStringFragment.length)]; } +#endif return nsAttributedStringFragment; }