IOs Cordova long-press shows text-select magnifying glass even with text-selection disabled, how to remove?

后端 未结 2 1295
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 20:00

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:

相关标签:
2条回答
  • 2020-12-15 20:43

    Apparently, in iOS 9 there is a bug which makes the -webkit-user-select: none; not work. There is a plugin which fixes this

    https://github.com/EddyVerbruggen/cordova-plugin-ios-longpress-fix

    Thanks to Frederik Wessberg https://stackoverflow.com/a/32737049/741850

    0 讨论(0)
  • 2020-12-15 20:47

    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

    0 讨论(0)
提交回复
热议问题