Improve text selection handling of links
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user