Remove workaround for iOS text clipping (#11455)
This commit is contained in:
+1
-1
@@ -108,7 +108,7 @@
|
|||||||
"@bsky.app/expo-scroll-edge-effect": "^0.1.9",
|
"@bsky.app/expo-scroll-edge-effect": "^0.1.9",
|
||||||
"@bsky.app/expo-translate-text": "^0.2.9",
|
"@bsky.app/expo-translate-text": "^0.2.9",
|
||||||
"@bsky.app/peek-menu": "^0.3.2",
|
"@bsky.app/peek-menu": "^0.3.2",
|
||||||
"@bsky.app/react-native-uitextview": "^2.6.0",
|
"@bsky.app/react-native-uitextview": "^2.7.0",
|
||||||
"@bsky.app/sift": "^0.3.9",
|
"@bsky.app/sift": "^0.3.9",
|
||||||
"@bsky.app/tapper": "^0.6.1",
|
"@bsky.app/tapper": "^0.6.1",
|
||||||
"@bsky.app/video": "0.3.6",
|
"@bsky.app/video": "0.3.6",
|
||||||
|
|||||||
Generated
+1250
-1552
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ import {type StyleProp, type TextStyle} from 'react-native'
|
|||||||
import {AppBskyRichtextFacet, RichText as RichTextAPI} from '@atproto/api'
|
import {AppBskyRichtextFacet, RichText as RichTextAPI} from '@atproto/api'
|
||||||
|
|
||||||
import {toShortUrl} from '#/lib/strings/url-helpers'
|
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 {isOnlyEmoji} from '#/alf/typography'
|
||||||
import {InlineLinkText, type LinkProps} from '#/components/Link'
|
import {InlineLinkText, type LinkProps} from '#/components/Link'
|
||||||
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
||||||
@@ -31,13 +31,12 @@ export type RichTextProps = TextStyleProp &
|
|||||||
/**
|
/**
|
||||||
* How far below the text baseline `suffix` extends, in px.
|
* How far below the text baseline `suffix` extends, in px.
|
||||||
*
|
*
|
||||||
* Inline views inside `Text` sit with their bottom edge on the baseline, so
|
* Android clips inline views that are translated below the measured text
|
||||||
* a suffix nudged below it overflows the `Text`'s measured bounds and
|
* bounds. Reserve matching room there and cancel it with a negative margin
|
||||||
* native clips it. We reserve this much room as bottom padding and cancel
|
* so content following the text does not move. iOS allows inline attachment
|
||||||
* it with an equal negative margin, so the suffix can paint without moving
|
* overflow through `RNUITextView` and does not need this compensation.
|
||||||
* anything after it. Pass the same offset the suffix nudges itself by.
|
|
||||||
*
|
*
|
||||||
* Overrides any `paddingBottom`/`marginBottom` set via `style`.
|
* Overrides any `paddingBottom`/`marginBottom` set via `style` on Android.
|
||||||
*/
|
*/
|
||||||
suffixOffset?: number
|
suffixOffset?: number
|
||||||
/**
|
/**
|
||||||
@@ -84,7 +83,7 @@ export function RichText({
|
|||||||
const plainStyles = style
|
const plainStyles = style
|
||||||
const suffixStyles =
|
const suffixStyles =
|
||||||
suffix && suffixOffset
|
suffix && suffixOffset
|
||||||
? native({paddingBottom: suffixOffset, marginBottom: -suffixOffset})
|
? android({paddingBottom: suffixOffset, marginBottom: -suffixOffset})
|
||||||
: null
|
: null
|
||||||
const interactiveStyles = [plainStyles, interactiveStyle]
|
const interactiveStyles = [plainStyles, interactiveStyle]
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ import {atoms as a, ios, platform, useTheme} from '#/alf'
|
|||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How far the inline badge is nudged below the text baseline to optically
|
* How far the inline badge is nudged below the text baseline. Android's
|
||||||
* center it. The containing `RichText` must reserve matching room via
|
* containing `RichText` reserves matching room via `suffixOffset`.
|
||||||
* `suffixOffset`, or native clips the overflow.
|
|
||||||
*/
|
*/
|
||||||
export const POST_NUMBER_INLINE_OFFSET = 6
|
export const POST_NUMBER_INLINE_OFFSET = 6
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user