Skip to content

Commit 9ebbe9b

Browse files
committed
tweaks
1 parent 19f45a9 commit 9ebbe9b

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewAccessibilityDelegate.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ internal class ReactTextViewAccessibilityDelegate(
291291
val accessibleLinks = mutableListOf<AccessibleLink>()
292292
val spans = text.getSpans(0, text.length, ClickableSpan::class.java)
293293

294+
// Do not generate virtual views if whole text is a single link
294295
if (!isWholeTextSingleLink(text, spans)) {
295296
spans.sortBy { text.getSpanStart(it) }
296297
for (i in spans.indices) {

packages/rn-tester/js/examples/Text/TextSharedExamples.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ component TextWithLinkRoleExample() {
199199

200200
return (
201201
<View>
202-
<Text>Regular Text</Text>
203-
204202
<Text role="link" style={styles.link} onPress={handlePress}>
205203
Link Text
206204
</Text>
@@ -212,26 +210,20 @@ component TextWithLinkRoleExample() {
212210
</Text>
213211

214212
<Text>
215-
Text{' '}
213+
Before{' '}
216214
<Text role="link" style={styles.link} onPress={handlePress}>
217-
Link
215+
Nested Link
218216
</Text>
217+
{' After'}
219218
</Text>
220219

221220
<Text>
222221
<Text role="link" style={styles.link} onPress={handlePress}>
223-
Link
224-
</Text>{' '}
225-
Text
226-
</Text>
227-
228-
<Text>
229-
<Text role="link" style={styles.link} onPress={handlePress}>
230-
Link 1
231-
</Text>{' '}
232-
Text{' '}
222+
Nested Link 1
223+
</Text>
224+
{' - '}
233225
<Text role="link" style={styles.link} onPress={handlePress}>
234-
Link 2
226+
Nested Link 2
235227
</Text>
236228
</Text>
237229
</View>

0 commit comments

Comments
 (0)