Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

"shouldTrigger" prop? #71

Closed
stevenmusumeche opened this issue Feb 6, 2017 · 4 comments
Closed

"shouldTrigger" prop? #71

stevenmusumeche opened this issue Feb 6, 2017 · 4 comments

Comments

@stevenmusumeche
Copy link

Hello, and thank you for this wonderful package. I am building an application where I only want to enable the context menu when certain conditions are met (for example, some value in state is true).

Is there a way to pass a prop to ContextMenuTrigger to make it ignore right clicks and display the default browser context menu when a prop like shouldTrigger is false?

I am able to conditionally wrap my component with ContextMenuTrigger, however, it is causing a problem for my use case. When the condition becomes true, the nodes inside of ContextMenuTrigger are recreated by React, and thus the user's selected text is removed.

@stevenmusumeche
Copy link
Author

stevenmusumeche commented Feb 7, 2017

wow @vkbansal, that was fast. Thank you so much! Do you have an idea of when this will be included in a release on npm?

@vkbansal
Copy link
Owner

vkbansal commented Feb 8, 2017

Most probably by the weekend.

@vkbansal
Copy link
Owner

I've released v2.2.0 with this change. Happy Coding!

@stevenmusumeche
Copy link
Author

thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants