mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan (#48296)
Summary: Fixes https://github.com/facebook/react-native/issues/48288 ## Changelog: [IOS] [FIXED] - Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan Pull Request resolved: https://github.com/facebook/react-native/pull/48296 Test Plan: Repro demo in https://github.com/facebook/react-native/issues/48288 Reviewed By: cipolleschi Differential Revision: D67334179 Pulled By: NickGerleman fbshipit-source-id: a9456a152d31bef1666669cbded28d99ec8a2028
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5370347f54
commit
5c789c3d3a
+6
-2
@@ -303,8 +303,12 @@ NSMutableDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttri
|
||||
auto textShadowOffset = textAttributes.textShadowOffset.value();
|
||||
NSShadow *shadow = [NSShadow new];
|
||||
shadow.shadowOffset = CGSize{textShadowOffset.width, textShadowOffset.height};
|
||||
shadow.shadowBlurRadius = textAttributes.textShadowRadius;
|
||||
shadow.shadowColor = RCTUIColorFromSharedColor(textAttributes.textShadowColor);
|
||||
if (!isnan(textAttributes.textShadowRadius)) {
|
||||
shadow.shadowBlurRadius = textAttributes.textShadowRadius;
|
||||
}
|
||||
if (textAttributes.textShadowColor) {
|
||||
shadow.shadowColor = RCTUIColorFromSharedColor(textAttributes.textShadowColor);
|
||||
}
|
||||
attributes[NSShadowAttributeName] = shadow;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user