At the end, you forgot to remove onClick on div element. Because of that, your element will close if you click on it. Anyway, thanks about this video. It's been realy helpful
instead of position: absolute, it's better to use fixed because the pageX and pageY are relative to the entire page. it will not interfere with the parent elements with position: relative.
Thank you for this helpful tutorial! I also want context menu to open upward and not downward if there is no space for menu at the bottom. Similarly I want menu to open leftward if there is no space for menu on the right. How to do this?
not sure what you mean by that. But if you figure this doesn't work, there's always the option to handle the right click with an eventListener which will always work
At the end, you forgot to remove onClick on div element. Because of that, your element will close if you click on it. Anyway, thanks about this video. It's been realy helpful
It's true, to avoid propagate.
Thanks a lot Josh! pageX and pageY helps a lot. I have to confess i solved it with css (horrible)
Great video but I'd like to suggest you that when you pass a ref to child or custom hook, make use of forwardRef
I never used forwardRef and still haven't check it's purpose. Could you explain why should use it to pass a ref to a child?
instead of position: absolute, it's better to use fixed because the pageX and pageY are relative to the entire page. it will not interfere with the parent elements with position: relative.
Great job!!! Thank you for useful information👍👍👍
Thank you for this helpful tutorial! I also want context menu to open upward and not downward if there is no space for menu at the bottom. Similarly I want menu to open leftward if there is no space for menu on the right. How to do this?
Such a nice clean video, ty
Cheers man, thanks
Very good!!! Good luck!
great stuff
very helpful videos! keep it up! :)
Appreciate you
How did you build the markdown editor is this a library?
Hi Josh, Does this work with nested menus?
not sure what you mean by that. But if you figure this doesn't work, there's always the option to handle the right click with an eventListener which will always work
Many Thanks
hey can you share your pc setup?