From db5a9704ff55fe2739d732634c5b854c0db88204 Mon Sep 17 00:00:00 2001 From: Andrew Kunkel Date: Tue, 13 Jan 2026 11:04:35 -0800 Subject: [PATCH] Updating iOS text stroke to match the vertical spacing of Android. --- .../Libraries/Text/Text/RCTTextShadowView.mm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm b/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm index 0b34a8629bd257..8dfbe573839511 100644 --- a/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm +++ b/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm @@ -411,22 +411,7 @@ - (CGFloat)lastBaselineForSize:(CGSize)size } }]; - // Account for stroke width in baseline calculation - __block CGFloat strokeWidth = 0; - [attributedText enumerateAttribute:@"RCTTextStrokeWidth" - inRange:NSMakeRange(0, attributedText.length) - options:0 - usingBlock:^(id value, NSRange range, BOOL *stop) { - if (value && [value isKindOfClass:[NSNumber class]]) { - CGFloat width = [value floatValue]; - if (width > 0) { - strokeWidth = MAX(strokeWidth, width); - *stop = YES; - } - } - }]; - - return size.height + maximumDescender + strokeWidth; + return size.height + maximumDescender; } static YGSize RCTTextShadowViewMeasure( @@ -473,6 +458,7 @@ static YGSize RCTTextShadowViewMeasure( }]; if (strokeWidth > 0) { + // Stroke does not increase vertcial height of the text to prevent UI shifts. size.width += strokeWidth; size.height += strokeWidth; }