josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
820 stars 108 forks source link

Feature: Disable of context menu #260

Closed ChrisABryant closed 1 year ago

ChrisABryant commented 1 year ago

Looks far better than previous json editors we've used! Color picker and boolean checkboxes were exactly what I was looking for.

Two things as we have a static structure that we only want to be able to change values and not schema. Used the following css with the jse-no-context class applied to the wrapper div. This prevents display of the context menu as well as attempts to edit the object keys. Would be nice if there were some prop flags for contextMenu and editableKeys.

.jse-no-context {

.jse-contextmenu { display: none !important; }

.jse-context-menu-pointer-anchor { display: none !important; }

.jse-context-menu-pointer { display: none !important; }

.jse-insert-area { display: none !important; }

.jse-key { pointer-events: none; cursor: pointer; }

}