fix: make code file preview text selectable on iOS (#447)
Add `selectable` prop to the code line Text component so users can long-press to select and copy text on iOS. On web/desktop this is already the default behavior via CSS user-select. Markdown file preview has a similar issue but requires a different fix (custom rules for react-native-markdown-display), left for a follow-up. Refs #238 Related #21 Co-authored-by: muzhi1991 <muzhi1991@limuzhideMac-mini-2.local>
This commit is contained in:
@@ -72,7 +72,7 @@ const CodeLine = React.memo(function CodeLine({
|
||||
<View style={[codeLineStyles.gutter, { width: gutterWidth }]}>
|
||||
<Text style={[codeLineStyles.gutterText, { color: baseColor }]}>{String(lineNumber)}</Text>
|
||||
</View>
|
||||
<Text style={codeLineStyles.lineText}>
|
||||
<Text selectable style={codeLineStyles.lineText}>
|
||||
{tokens.map((token, index) => (
|
||||
<Text
|
||||
key={index}
|
||||
|
||||
Reference in New Issue
Block a user