Comments (2)
I think the easiest way is to attach an onClick
handler to menu button and call stopPropagation
from there:
<Menu menuButton={<MenuButton onClick={e => e.stopPropagation()}>Menu</MenuButton>}>
<MenuItem>Cut</MenuItem>
<MenuItem>Copy</MenuItem>
<MenuItem>Paste</MenuItem>
</Menu>
from react-menu.
I think the easiest way is to attach an
onClick
handler to menu button and callstopPropagation
from there:<Menu menuButton={<MenuButton onClick={e => e.stopPropagation()}>Menu</MenuButton>}> <MenuItem>Cut</MenuItem> <MenuItem>Copy</MenuItem> <MenuItem>Paste</MenuItem> </Menu>
Sorry about that, I didnt realise that onClick can be called on MenuButton.
BTW, React-Menu is perhaps the most comprehensive menu component Ive discovered. Thank you!
from react-menu.
Related Issues (20)
- How to avoid child menu render when it is not visible? HOT 2
- Submenu not focused when using keyboard navigation HOT 1
- InitialMounted Submenu items
- Null menuRef when hot reload React HOT 2
- Getting type related when running Stryker HOT 5
- FocusableItem value is undefined HOT 2
- ControlledMenu keepOpen at top level trigger HOT 2
- Adjust Menus to support transparent blur background HOT 2
- Unhover a Submenu programmatically HOT 2
- Adding closeMenuOnSelect prop HOT 1
- Decrease the time it takes to open/close a sub menu HOT 1
- menuRef.current is null when ControlledMenu is rendered on a Modal HOT 1
- Expected Focus on menu close w/controlled menu HOT 1
- how to open submenu programmatically? HOT 1
- is it possible to render menu items without having menu button? HOT 1
- how to open submenus at the same level visually? HOT 5
- how to have focus on item on menu open HOT 2
- How to allow tooltips on disabled menu items? HOT 2
- Modify the className for FocusableItem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-menu.