5

I found this example to create a right-click menu in Svelte, which works fine. It is bound on the whole document body using svelte:body.

What I would like to have is a right-click menu only in context of specific Component e.g. a list of steps, where with the menu I could have actions like "mark all items in the list before" or "mark all items after the current step as red".

dvelderp
  • 101
  • 1
  • 6

1 Answers1

5

OK, I had to define the Context Menu in the Step component itself to make it work.

Here's my solution: https://svelte.dev/repl/16c8a02ebaa9425a9cbbfd66feea1a9e?version=3.29.0

dvelderp
  • 101
  • 1
  • 6