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

Allow custom editable value renderers

Open VincentK-ZA opened this issue 8 months ago • 2 comments

Looking at the custom value renderer examples, none of them really take over the the editing rendering.

I've been working on getting this work, but from I could see, I had to fork the project in order to get it working.

Here's an example of a custom editable div in our project, using codemirror: custom-editable-div

Please see this PR (internal to the forked repo for now) for what I believe would need to be changed.
This includes an EditableCodeMirror component for demo purposes on the examples page. Our actual implementation relies on getContext to get actual completion/suggestion data, since I didn't want to pass any more props through EditableValue.

Let me know what you think about this proposal, and if you'd be open to merging a change like this into the project.

There are some tricky things regarding focus/mousedown events that I have not managed to solve as of yet.
For example, I couldn't get the suggestions panel to stay open if the user tries to drag the scrollbar to see more suggestions.

VincentK-ZA avatar Jun 24 '24 17:06 VincentK-ZA