0

I am working on a React Native application where I want to modify the native text selection menu (the menu that appears when you long-press on text). Specifically, I want to add a custom option alongside the default ones like Copy, Look Up, Translate, Search Web, and Share.

Is there a way to modify the native text selection menu inside a WebView on iOS? How can I add a custom menu option to the default text selection menu while keeping all the default options intact?

I have explored modifying the native text selection menu inside a WebView on iOS by looking into custom context menus and JavaScript injection. I tried using injectedJavaScript in react-native-webview to detect text selection and add a custom menu option. However, this only allowed me to capture selected text but not modify the native menu.

I expected to see my custom menu option appear alongside the default ones like Copy, Look Up, Translate, etc., but the native menu remained unchanged. It seems iOS does not provide direct access to modify the WebView's native text selection menu. I'm looking for alternative solutions, possibly involving custom WKWebView configurations or other native code approaches.

1
  • have you ever come up with a solution to this, modify the native text selection menu inside a WebView on iOS Commented Mar 27 at 9:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.