question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to disable a ContextMenuView in a list

See original GitHub issue

Let’s say I have a list of items in a FlatList and I want to disable the ContextMenuView on a few of these items.

How would I go around doing that?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nandorojocommented, Nov 30, 2021

but I would still like the children of the context menu to show up

I agree it’s a nicer DX with the Boolean, but that’s still possible FWIW:

let Wrapper = React.Fragment
let wrapperProps = {}
if (isMenu) {
  Wrapper = ContextMenu
  wrapperProps = {...propsHere}
}

return <Wrapper {...wrapperProps}>{children}</Wrapper>
1reaction
Kordonmecommented, Nov 30, 2021

Wow, thanks for his @dominicstop 🚀

And yes, I could conditionally render it, but I would still like the children of the context menu to show up. Having a boolean makes this less cluttered for me as a developer. @nandorojo

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to disable the context menu for particular ListView items ...
In onCreate(), I am registering my listview with registerForContextMenu(listview) .And in onListItemClick(ListView l, View v, int position, long ...
Read more >
ShellMenuView: Disable / enable context menu items ... - NirSoft
Display the list of static menu items that appeared in the context menu of Windows Explorer and allows you to disable and enable...
Read more >
Disabling or Removing Context Menu Items for a Specific Object
In this example, you disable the Delete context menu item on the Folder Browsing page, but only when ... Launch MicroStrategy Web to...
Read more >
List View | Custom Context Menu | JET Developer Cookbook
A list view displays data items as a list or a grid with highly interactive features. Associate a custom context menu to a...
Read more >
Disable Or Enable Windows 11 Context Menu How To Guide
From Start Menu and Taskbar ->open Disable Context menus in the Start Menu policy setting. Select the Enabled option for disabling the context ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found