Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Webview opening links on external browser when long pressed #1108

Open
CDAfonso opened this issue Oct 16, 2024 · 3 comments
Open

iOS Webview opening links on external browser when long pressed #1108

CDAfonso opened this issue Oct 16, 2024 · 3 comments

Comments

@CDAfonso
Copy link

Hello,

I'm having this issue on iOS:
When clicking links on the webpage loaded on the webview, if long pressing the links it opens on safari, instead of the app webview.

How to solve this? It is the first time it is happening to me.

Best Regards

@CDAfonso
Copy link
Author

SOLVED:

Using css:

body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

@KojiNakamaru
Copy link
Member

You may also specify wkAllowsLinkPreview: false for Init().

cf. https://developer.apple.com/documentation/webkit/wkwebview/1415000-allowslinkpreview?language=objc

@CDAfonso
Copy link
Author

You may also specify wkAllowsLinkPreview: false for Init().

cf. https://developer.apple.com/documentation/webkit/wkwebview/1415000-allowslinkpreview?language=objc

Thanks @KojiNakamaru , it is indeed the best solution!
Keep rocking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants