fix(android): tappable spans aren't visible on single-line labels (#10055)

This commit is contained in:
Dimitris-Rafail Katsampas
2022-11-07 18:52:24 +02:00
committed by GitHub
parent 6cabcab0d5
commit 57657075ca

View File

@ -494,6 +494,9 @@ export class TextBase extends TextBaseCommon {
if (this._tappable !== tappable) { if (this._tappable !== tappable) {
this._tappable = tappable; this._tappable = tappable;
if (this._tappable) { if (this._tappable) {
// Setting singleLine to true results in conflicts with LinkMovementMethod
// See https://stackoverflow.com/a/34407901
this.nativeTextViewProtected.setSingleLine(false);
this.nativeTextViewProtected.setMovementMethod(android.text.method.LinkMovementMethod.getInstance()); this.nativeTextViewProtected.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
this.nativeTextViewProtected.setHighlightColor(null); this.nativeTextViewProtected.setHighlightColor(null);
} else { } else {