I'm developing an app using ionic3, but when using it on android, I can't select text inside <ion-input>
, <input>
, <ion-textarea>
or <textarea>
tags.
When testing it in the browser, it works fine. However when I'm using it in android, tapping the input, long or short only toggles the keyboard and it's impossible to ever select text.
After extended researches, I realized that if my <ion-input>
or <ion-textarea>
is in an <ion-item>
it works fine, and text can be selected and copied.
For many design reasons, I don't want to have to put inputs in <ion-item>
elements, because it creates many other problems in the app.
I think that the <ion-item>
element must modify the behavior of sub-elements, like allowing copying text which is not permitted by default for other elements.
So I wonder if I could reproduce that behavior without having to wrap inputs in <ion-item>
elements.
I tried using this in my scss file but without success:
ion-input input, ion-textarea textarea, input, textarea {
-webkit-user-select: auto;
// I also tried -webkit-user-select: text;
}
If I do like so:
ion-input, ion-textarea {
-webkit-user-select: auto;
// I also tried -webkit-user-select: text;
}
I can select text, but not while inputing, I'm selecting the input itself.
What I want is simply to be able to select while inputing, copy, paste...
Any idea would be deeply appreciated :)
ion-item
and solve design issues after that. – Uthropion-item
, like I was doing before. It works that way, however brings other limitations to the app. I'd still really love to find a solution without having to useion-item
. – Integration