-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContextMenu & transform #27
Comments
Hey @brezetsky , Indeed, I reproduced the issue there: I'll fix it asap. |
@brezetsky I don't know if I'll be able to fix it but I found a post which explains what's going on. |
@fkhadra yes, I read about this. But I think context menu should work from any place on the page. In this case, it should be moved to body and then it will work. Is it possible? |
Hmm, it can do the job. Just thinking if there is a way to implement it without relying on findDOMNode. I'm not even sure that findDOMNode can do the trick. I need to find if there is a pattern for this kind of use. |
Hey @brezetsky , |
Hey @fkhadra , Cool. Thanks. |
Hi @fkhadra, Will you publish it today? |
Hey @brezetsky, I will in a few minutes. I'll let you know |
@brezetsky published ! |
Great! Thanks! |
Hi @fkhadra, it doesn't work now - https://codesandbox.io/s/j2nq05qox9 |
weird @brezetsky, it's working for me. Cache issue ? |
For your app, maybe delete node_modules and reinstall the package |
I have the "Did you forgot to bind the event?" error with 2.1.0 update too. Thank you for the lib! |
hmm @brezetsky, @vladminsky I think I know why it's happening. This error means that the event is not bound. Can you show me where in your application you are rendering the ContextMenu component? Did you render it in the root component ? Anyway, I need to add a rule to check if in that case the event is bound. I'll fix it today. |
Thank you for the quick reply.
No. I render ContextMenuProvider and ContextMenu within a subcomponent since it is the only place I need a context menu. |
Hey @fkhadra, I tried to delete node_modules few times. Sometimes, context menu worked form for few elements, but not for all. That's why I continue to use the previous version. Waiting for new version :) |
@fkhadra , any updates today? |
Hello @brezetsky @vladminsky, I published a new version could you try it and tell me if it fix your issue please ? Don't forget to clear your cache 😁 . |
Hello @fkhadra |
I don't have a snippet so it's hard to reproduce.Can you provide a snippet, it will be easier for me to see what's going on. |
I'm having the same issue. Assume that ContextMenuComponent is returning
This produces the same event not bound error referenced above. |
I'll work on it tonight. I think i will use react portal instead of the solution I put in place. PS: I hate computer |
Will try to make snippet today. |
im trying to reproduce the bug first |
hey @fkhadra , |
Hey @brezetsky, Thanks for the snippet i'm working on it |
@brezetsky I'm able to reproduce the bug thanks to your snippet. Usually, when I work on a package I use npm link. With npm link I don't have the bug. I'm trying to understand but this is the first time I encounter such a behavior. I even tried to pack the lib with npm pack and install it from the packaged archive but still buggy. Edit: diff output nothing also |
@fkhadra , |
@brezetsky I finally found the bug 🎉 ! |
@fkhadra really wait it! |
You can add tests later :) |
@fkhadra could I expect the release today? I am sorry that I disturb you, but I want to implement new version of context menu in my project :) |
I pushed the new version. You won't get the "Did you forgot to bind an event" message. @brezetsky regarding your snippet won't work, only the parent menu will be displayed. To fix it move the class ContextMenuClass extends React.Component {
render() {
const fn = () => { };
return (
<div>
<ContextMenuProvider id={'context_menu'}>
ContextMenu
<ContextNestedMenuClass /> -> Remove this
</ContextMenuProvider>
<ContextMenu theme="dark" id={'context_menu'}>
<Item onClick={fn} disabled>Unselect</Item>
<Item onClick={fn} disabled={true}>select</Item>
<Item onClick={fn}>Delete</Item>
</ContextMenu>
{**Put the <ContextNestedMenuClass /> here instead**}
</div>
)
}
} Sorry for the late release btw |
@fkhadra but this Nested context menu worked before for me |
Please, find snippet - https://codesandbox.io/s/zl9n9496wp |
@brezetsky are you sure it was working that way before ? Anyway I understand your use case. |
I ran into the same issue here, can't tell if it was resolved and regressed from the old discussion above or not, but I was able to fix it by throwing the {ReactDOM.createPortal(
this.renderContextMenu(), // this renders the `<Menu>`
document.body
)} |
Hi fkhadra,
I got next problem: I have the parent element with style transform. When I add context menu on child element, then its behaviour incorrectly.
Please, find example below.
The text was updated successfully, but these errors were encountered: