Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selection/Edit menu in React Native

Tags:

react-native

In iOS it's possible to configure a Selection and Edit Menu. That looks like this: selection_menu

Also, the API is displayed here: https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/AddingCustomEditMenuItems/AddingCustomEditMenuItems.html

So is this possible on React Native? I am building a chat app where we need to allow copying messages and also custom menu items.

like image 610
Fenda Avatar asked Mar 07 '16 13:03

Fenda


1 Answers

On iOS, customising the edit menu is achieved through UIMenuController. However if we look at the react-native repo the only occurrence of that class (until today) can be found in the RCTTextView class.

If you want to use it for other components you'll have to bridge it yourself.

Some 3rd party libraries exist.

like image 92
Alexis Avatar answered Nov 15 '22 06:11

Alexis