-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom editable value renderers #454
Comments
Thanks for your inputs Vincent. Can you explain what you think is missing in API in order to (easily) create an editable value component yourself? |
I've added an example showing how to create custom editable input: |
Hi Jos Thanks for your reply and for the examples. In our case, we are trying to make a custom editable input that functions and looks almost identical to the default editable div, just with autocompletions added. So there are some internal/not exported utility functions that would be nice to reuse as is. Lastly, there's the case of some internal logic checking specifically for a |
It should be as easy as possible to to extend and customize the editor, so this is really helpful! In #461 I've exported more utility functions. Would that solve your issue? We can address the magic internal logic via #460. I like getting rid of this special code. Note that there the code uses an internal function |
Hi Jos Thanks for the quick work on this, those two PR's look good, just on the first one I added a comment to also export the stringConvert utility function. Removing the internal magic and using a callback seems like a better approach for sure. For what it's worth, we only really have the cancel function hooked up, and aren't relying on refresh at all (It's just a Looking forward to v1 |
Thanks for checking out the PR's! |
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:
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.
The text was updated successfully, but these errors were encountered: