Improve text selection handling of links

This commit is contained in:
Paul Frazee
2023-04-11 15:15:03 -07:00
parent d59d701e79
commit dc071bc659
2 changed files with 12 additions and 6 deletions
+5 -4
View File
@@ -2,6 +2,7 @@ import React from 'react'
import {Text as RNText, TextInput, TextProps} from 'react-native'
import {s, lh} from 'lib/styles'
import {useTheme, TypographyVariant} from 'lib/ThemeContext'
import {isNative} from 'platform/detection'
export type CustomTextProps = TextProps & {
type?: TypographyVariant
@@ -19,15 +20,15 @@ export function Text({
const theme = useTheme()
const typography = theme.typography[type]
const lineHeightStyle = lineHeight ? lh(theme, type, lineHeight) : undefined
if (selectable) {
if (selectable && isNative) {
return (
<TextInput
value={children as string}
scrollEnabled={false}
style={[s.black, typography, lineHeightStyle, style]}
editable={false}
multiline={true}
/>
multiline={true}>
{children}
</TextInput>
)
}
return (