Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic 2: How to make text selectable?

Tags:

I want users to be able to select text content (in ionic 2) so that they can copy it and paste it elsewhere, but it seems that text selection has been disabled. Users can select text that is in an input or a textarea, but I want them to be able to select even regular content text. Is there a way to re-enable text selection?

like image 371
Manspof Avatar asked Nov 18 '16 08:11

Manspof


1 Answers

I added

body { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; } 

to the app.scss file

For individual items, since this is SCSS, you can also create a mix-in with those 4 css lines. Keep in mind Safari or other browsers may not respond well to just user-select.

like image 128
Dmitri R117 Avatar answered Sep 19 '22 15:09

Dmitri R117