Allow user to select text


#1

Hi there,

I’m using Angular 2 and need to display a large block of read-only text, but I want the user to at least be able to highlight items in the text and copy them to the clipboard. Is there a way to do this? Setting a TextView to editable=“false” doesn’t seem to allow this. I’ve also tried an HtmlView, but caused an exception due to bad HTML in the string.

Any help would be appreciated, thanks.


#2

@Gryffin Did you ever figure anything out for this? I’m trying to do the same thing


#3

Setting editable false on TextField itself should do the trick in iOS, but in Android you need to do one more step, may be in the loaded event.

if (isAndroid) {
  (<TextField>event.object).nativeView.setTextIsSelectable(true);
}