Reputation: 757
I want to disable the text selection effect (the popup tool for copy/paste/select-all on Andorid) on some DOM elements of a phonegap web app. Mostly, I want to enable text selection in textarea and input.
edit -- Not only text controls, but also div with 'editable' class name are expected to allow text selection.
I read a solution that totally disable text selection at disabling-text-selection-in-phonegap. How can I just disable it for elements besides textarea and input?
Upvotes: 0
Views: 767
Reputation: 6544
You could use as such,
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
super.appView.setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
if(!(v instanceof TextView)) {
return true;
}
}
});
}
}
Hope this helps you.
Upvotes: 1