14

iOS9_glass

I have tested several workarounds to disable the annoying magnifying glass with css, but on my iOS9 meteor cordova build it appears for a moment and fades out after some ms.

it was working on iOS 8 but not on iOS 9 now with this css code:

body, body * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-user-callout: none !important;
    -webkit-touch-callout: none !important;
}
input, textarea {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-user-callout: default !important;
    -webkit-touch-callout: default !important;
}
*{
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none; /* Firefox all */
    -ms-user-select: none; /* IE 10+ */
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-modify: none;
}

I missed something for iOS 9?

Matthias A. Eckhart
  • 5,136
  • 4
  • 27
  • 34
Dude
  • 1,045
  • 2
  • 15
  • 36
  • Possible duplicate of [IOs Cordova long-press shows text-select magnifying glass even with text-selection disabled, how to remove?](http://stackoverflow.com/questions/32812308/ios-cordova-long-press-shows-text-select-magnifying-glass-even-with-text-selecti) – mpoisot Dec 21 '16 at 23:52
  • looks like I was first – Dude Jan 09 '17 at 14:07
  • The fix is no longer working in iOS 15.1. See https://github.com/apache/cordova-ios/issues/1216 – Teodor Sandu Jan 18 '22 at 08:29

2 Answers2

11

Yes, it is related to iOS9. Since you are a Cordova user, this plugin will fix the problem for you: https://github.com/EddyVerbruggen/cordova-plugin-ios-longpress-fix

It has to do with the UILongPressGestureRecognizer executing before handling the -webkit-user-select: none in your css.

I hope this helps you out.

  • be aware that answers with just links are removed, somebody might report and it will be deleted (it happens to me al the time), better change it to a comment or put the plugin code on the answer – jcesarmobile Sep 23 '15 at 13:25
  • 3
    If we don't use Cordova , is there any solution ? – Hassan Taleb Sep 25 '15 at 00:00
  • this plugin is outdated now with meteor 1.3 because its not using web view anymore – Dude Apr 21 '16 at 17:29
3

The plugin Frederik mentioned is now build into cordova see https://github.com/apache/cordova-ios/pull/174

To enable the fix insert <preference name="SuppressesLongPressGesture" value="true" /> into config.xml

David Schumann
  • 13,380
  • 9
  • 75
  • 96
Adri Van Houdt
  • 435
  • 4
  • 13