Remove workaround for iOS text clipping (#11455)

This commit is contained in:
DS Boyce
2026-08-12 14:55:25 -07:00
committed by GitHub
parent f5f980e58e
commit aafcb2eeff
4 changed files with 1260 additions and 1564 deletions
+7 -8
View File
@@ -3,7 +3,7 @@ import {type StyleProp, type TextStyle} from 'react-native'
import {AppBskyRichtextFacet, RichText as RichTextAPI} from '@atproto/api'
import {toShortUrl} from '#/lib/strings/url-helpers'
import {atoms as a, flatten, native, type TextStyleProp} from '#/alf'
import {android, atoms as a, flatten, type TextStyleProp} from '#/alf'
import {isOnlyEmoji} from '#/alf/typography'
import {InlineLinkText, type LinkProps} from '#/components/Link'
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
@@ -31,13 +31,12 @@ export type RichTextProps = TextStyleProp &
/**
* How far below the text baseline `suffix` extends, in px.
*
* Inline views inside `Text` sit with their bottom edge on the baseline, so
* a suffix nudged below it overflows the `Text`'s measured bounds and
* native clips it. We reserve this much room as bottom padding and cancel
* it with an equal negative margin, so the suffix can paint without moving
* anything after it. Pass the same offset the suffix nudges itself by.
* Android clips inline views that are translated below the measured text
* bounds. Reserve matching room there and cancel it with a negative margin
* so content following the text does not move. iOS allows inline attachment
* overflow through `RNUITextView` and does not need this compensation.
*
* Overrides any `paddingBottom`/`marginBottom` set via `style`.
* Overrides any `paddingBottom`/`marginBottom` set via `style` on Android.
*/
suffixOffset?: number
/**
@@ -84,7 +83,7 @@ export function RichText({
const plainStyles = style
const suffixStyles =
suffix && suffixOffset
? native({paddingBottom: suffixOffset, marginBottom: -suffixOffset})
? android({paddingBottom: suffixOffset, marginBottom: -suffixOffset})
: null
const interactiveStyles = [plainStyles, interactiveStyle]