How to create a context sensitive right-click menu in svelte?

Viewed 1616

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".

2 Answers
Related