即使禁用了文本选择,IOs Cordova 长按也会显示文本选择放大镜,如何删除? [英] IOs Cordova long-press shows text-select magnifying glass even with text-selection disabled, how to remove?
问题描述
我有一个很奇怪的问题.在 iOS 上的cordova 应用程序中,当我长按应用程序中的任意位置时,我会看到一个弹出式文本选择放大镜.
示例:
顶部的气泡被锁定在屏幕的顶部,并在我的手指左右移动时跟随我的 x 位置.
我尝试添加以下 css,人们认为应该可以解决我的问题:
* {-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-touch-callout:无;-webkit-user-select:无;}
这没有帮助.查看 web-inspector 中的内容,我可以确认此 css 已成功添加到所有内容中.我已经尝试了许多不同的普通 touch-callout: none
和 user-select: none
变体,每个人都建议,但似乎没有任何帮助.
我还尝试删除所有 javascript 和所有 CSS,除了上述提到的一个简单变体之外,放大镜仍然出现.
我怎样才能让它消失?是否有任何插件可能导致此问题?非常感谢任何帮助.
Cordova 插件:
- com.mbppower.camerapreview
- cordova-plugin-statusbar
- cordova-plugin-whitelist
- 离子插件键盘
- org.apache.cordova.camera
- org.apache.cordova.console
- org.apache.cordova.device
- org.apache.cordova.dialogs
- org.apache.cordova.file
- org.apache.cordova.file-transfer
- org.apache.cordova.network-information
- org.apache.cordova.vibration
Cordova 版本:5.1.1iPhone 5s 与 iOS 版本:9.0.1
感谢 Automatico!让我免于更多的挫折.
然而,从那时起,该代码似乎已合并到主线cordova中,只需添加
即可启用这对我来说非常有效!
这是带来它的提交和注释
https://github.com/apache/cordova-ios/commit/1ad9951c80dbf97281e763f5f27a9bc8852c0537"
I have a very weird problem. In my cordova app on iOS I am getting a pop-up text-select magnifying glass when I long-press anywhere in the app.
Example:
The bubble at the top is locked to the top of the screen, and follow my x-position when moving my finger from side to side.
I have tried to add the following css which people say should fix my issue:
* {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
-webkit-user-select: none;
}
This does not help. Looking at things in the web-inspector, I can confirm that this css is successfully added to everything. I have tried a bunch of different variation of the normal touch-callout: none
and user-select: none
everyone suggest and nothing seem to help.
I have also tried to remove all javascript and all CSS except a simple variation of the above mentioned, and the magnifying glass still appears.
How can I get it to go away? Is there any plugin that can be causing this issue? Any help is much appreciated.
Cordova plugins:
- com.mbppower.camerapreview
- cordova-plugin-statusbar
- cordova-plugin-whitelist
- ionic-plugin-keyboard
- org.apache.cordova.camera
- org.apache.cordova.console
- org.apache.cordova.device
- org.apache.cordova.dialogs
- org.apache.cordova.file
- org.apache.cordova.file-transfer
- org.apache.cordova.network-information
- org.apache.cordova.vibration
Cordova version: 5.1.1 iPhone 5s with iOS version: 9.0.1
Thank you for that Automatico! Saved me from a lot more frustration.
Since then however it looks like that code has been merged into mainline cordova and can just be enabled by adding
<preference name="SuppressesLongPressGesture" value="true" />
to config.xml
That worked perfectly for me!
Here is the commit and notes that brought it in
https://github.com/apache/cordova-ios/commit/1ad9951c80dbf97281e763f5f27a9bc8852c0537
这篇关于即使禁用了文本选择,IOs Cordova 长按也会显示文本选择放大镜,如何删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!