0

I use a WKWebView to display web content in my app. I want to make the content to feel as native as possible.

I've already added this CSS to the web site loaded in the WKWebView:

* {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

Still, when long tapping on images, they can be "selected and moved around".

How can I prevent this?

PS: On iOS 15.1 when log tapping on text, the text magnification glass appears. This doesn't happen in iOS 15.3.1.

themenace
  • 2,601
  • 2
  • 20
  • 33

1 Answers1

1

You can do that in two ways (tested on iOS 15.5):

1: CSS

img {
    user-drag: none;    
    -webkit-user-drag: none;    
}

2: HTML

<img src = "image.png" alt = "image" draggable = "false" />
Martin
  • 684
  • 8
  • 12