@@ -595,11 +595,10 @@ protected void onPopulateNodeForVirtualView(
595595 return ;
596596 }
597597 if (mView instanceof TextView ) {
598- CharSequence textViewText = ((TextView ) mView ).getText ();
599- SpannableString spannableString = new SpannableString (textViewText );
598+ SpannableString spannableString = new SpannableString (ttsSpan .description );
600599 spannableString .setSpan (
601600 ttsSpan .span ,
602- java .lang .Math .min (textViewText .length (), ttsSpan .start ),
601+ java .lang .Math .min (spannableString .length (), ttsSpan .start ),
603602 java .lang .Math .max (ttsSpan .start , ttsSpan .end - 1 ),
604603 0 );
605604 node .setContentDescription (spannableString );
@@ -685,9 +684,10 @@ public AccessibilityLinks(ReactTtsSpan[] spans, Spannable text) {
685684
686685 final AccessibleLink link = new AccessibleLink ();
687686 link .span = span ;
688- link .start = start ;
689- link .description = text .subSequence (start , end ).toString ();
690- link .end = end ;
687+ SpannableString spannableDescription = new SpannableString (text .subSequence (start , end ));
688+ link .description = spannableDescription .toString ();
689+ link .start = spannableDescription .getSpanStart (span );
690+ link .end = spannableDescription .getSpanEnd (span );
691691
692692 // ID is the reverse of what is expected, since the ClickableSpans are returned in reverse
693693 // order due to being added in reverse order. If we don't do this, focus will move to the
0 commit comments