svelte-jsoneditor icon indicating copy to clipboard operation
svelte-jsoneditor copied to clipboard

Implement an onRenderContextMenu to customize the context menu

Open Josnaaa opened this issue 2 years ago • 4 comments

As we already have a insert, remove, transfer. Are we allowed to add or delete this options???

Josnaaa avatar May 19 '22 10:05 Josnaaa

Right now there is an option to customize the main menu with onRenderMenu. There is no option yet to customize the context menu. Is that what you mean?

josdejong avatar May 19 '22 13:05 josdejong

the context menu is nothing but the below right?? If yes , then yes that's what i meant. Screenshot from 2022-05-19 19-22-14

Josnaaa avatar May 19 '22 13:05 Josnaaa

Indeed, that's the context menu (which isn't yet customizable)

josdejong avatar May 19 '22 14:05 josdejong

okay, Thank you for the information.

Josnaaa avatar May 19 '22 14:05 Josnaaa

I'm really looking forward to this feature, in fact I'm currently using the react version of the editor, but in order to implement the custom menu I had to folk a copy of the source code to try and modify the svelte code myself, however that's not something I'm good at and it's very annoying, I'll be relieved the day the feature is implemented!

1pone avatar Nov 29 '23 09:11 1pone

👍 help implementing onRenderContextMenu would be welcome.

josdejong avatar Nov 29 '23 09:11 josdejong

A new option onRenderContextMenu is now available in v0.21.0.

josdejong avatar Dec 20 '23 14:12 josdejong

A new option onRenderContextMenu is now available in v0.21.0.

good to know that, is there any example / demo code for usage of onRenderContextMenu

toolsh avatar Dec 22 '23 10:12 toolsh

There is an example here: /examples/custom_context_menu_buttons/+page.svelte.

At this moment there is still is an issue with the new onRenderContextMenu, see #379. It's fixed but not yet published.

josdejong avatar Dec 22 '23 11:12 josdejong