User-select: text not working in ionic 5

hi, I want to let the user select a text by long-press/clicknDrag a word(s) to mark it (like user-select: text is not working.
how can I achieve this in ionic? can anyone please help?

I’ve noticed the same behavior. It seems to be related to the shadow-root feature.

If you place the following code at a very top in any of your global stylesheets, you’ll notice, that it will work for some elements, to be more precise, for the elements that do not use the shadow-root:

* {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;

This code will simply enable the text selection for all browsers and all elements. You can define it for any specific elements you want.

Now the behavior I’ve noticed: Any custom web component, f. e. <ion-card> will get this css property, but won’t behave as it should as it uses the shadow-root.

There are also various of bugs I’ve found across the internet, f. e.:

I’ve tried nearly everything to make it work, but it’s impossible. The only behavior I’ve noticed is, that it will work with a right click on the word you want to select, but only for this one word, no more.

Hopefully there will be a fix soon as it’s a little bit anoying.

Hope it helps!