⭐️ Impl. ContextMenuView.isContextMenuEnabled
This commit is contained in:
parent
748997dd5e
commit
6b606da0fd
@ -54,7 +54,7 @@
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
|
||||
@ -31,9 +31,9 @@ RCT_EXPORT_VIEW_PROPERTY(onPressMenuItem , RCTBubblingEventBlock);
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(menuConfig, NSDictionary);
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(enableContextMenu , BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(isMenuPrimaryAction, BOOL);
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(enableContextMenu , BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(isMenuPrimaryAction , BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(isContextMenuEnabled, BOOL);
|
||||
|
||||
// MARK: - View Manager Commands
|
||||
// ------------------------------
|
||||
|
||||
@ -110,6 +110,8 @@ class RNIContextMenuView: UIView {
|
||||
|
||||
@objc var shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle = true;
|
||||
|
||||
@objc var isContextMenuEnabled = true;
|
||||
|
||||
// MARK: - Init
|
||||
// ------------
|
||||
|
||||
@ -320,6 +322,8 @@ extension RNIContextMenuView: UIContextMenuInteractionDelegate {
|
||||
configurationForMenuAtLocation location: CGPoint
|
||||
) -> UIContextMenuConfiguration? {
|
||||
|
||||
guard self.isContextMenuEnabled else { return nil };
|
||||
|
||||
self.onMenuWillCreate?([:]);
|
||||
|
||||
return UIContextMenuConfiguration(
|
||||
|
||||
@ -35,4 +35,6 @@ RCT_EXPORT_VIEW_PROPERTY(previewConfig, NSDictionary);
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle, BOOL);
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(isContextMenuEnabled, BOOL);
|
||||
|
||||
@end
|
||||
|
||||
@ -23,6 +23,7 @@ export type ContextMenuViewBaseProps = Pick<RNIContextMenuViewProps,
|
||||
| 'menuConfig'
|
||||
| 'previewConfig'
|
||||
| 'shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle'
|
||||
| 'isContextMenuEnabled'
|
||||
// Lifecycle Events
|
||||
| 'onMenuWillShow'
|
||||
| 'onMenuWillHide'
|
||||
|
||||
@ -35,6 +35,8 @@ export type RNIContextMenuViewProps = ViewProps & {
|
||||
* */
|
||||
shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle?: boolean;
|
||||
|
||||
isContextMenuEnabled?: boolean;
|
||||
|
||||
// Events - Lifecycle
|
||||
// ------------------
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user