Comments (4)
Hi @deser , yes it is totally possible to have different context menus, even inside the same component. Just call the hook once for every menu and then use the provided binds to bind the logic to different menus. I'll find time to create a codesandbox with a working example later today.
from use-context-menu.
Many thanks!
from use-context-menu.
is it also possible to have a lot of triggers for one menu? Imagine than I have on a page a lot of elements\components with let's say different types. So elements of type a
should trigger context menu with items k
and c
when elements with type b
should have context menu with items h
and m
.
UPD:
Seems I can utilize useContextTrigger
with different collect
to differentiate element types.
from use-context-menu.
Exactly, you can call useContextTrigger
do generate different triggers, each with a custom config
from use-context-menu.
Related Issues (12)
- Plans to maintain HOT 1
- Left clicking on trigger element doesn't hide context menu
- context-menu appear on the left of the window when i'm closing it
- Focus does not reset on menu close. HOT 1
- Automatically set visibility to false onClick HOT 2
- holdToDisplay should be 1s by default only for touch events.
- Do you plan to support typescript? HOT 1
- event in collect function HOT 1
- Default menu shows up when ctrl + clicking HOT 2
- Position fixed is unacceptable HOT 4
- Context menu is shown on desktop after `holdToDisplay` HOT 2
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 use-context-menu.