-
First of all thanks for this amazing piece of work! I am extremely glad this project exists :) One thing that I only found a workaround for so far is a use case where you have an element that has a custom property(e.g. an image with src) where said property should not be directly editable through slate but should be set externally (e.g. an image picker). Workaround: what I will do now, is assign a temporary id as a property to each Node that needs it, (images, links, video-embeds) during deserialization and find the element that way. Alternative: You have to have said image selected, but I dont love that from a UX point of view as just clicking it would be much more intuitive. What I would love to do: get the path though the ElementProps and use that directly to set the property on the correct element. I'm not sure if that is easily doable, or if there are reasons or philosophies that make this not feasible but I'd love to get some opinions on this, or some clarifications in case I understood something wrong and there are already ways to accomplish this. Also the image is just an example here, I think there are plenty elements that would be easier to implement this way. Thank you again for your amazing work, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can use ‘ReactEditor.findPath(editor, props.element)’ to get the path inside a rendered element component |
Beta Was this translation helpful? Give feedback.
-
Amazing! That was the missing link, thank you so much! :)
|
Beta Was this translation helpful? Give feedback.
You can use ‘ReactEditor.findPath(editor, props.element)’ to get the path inside a rendered element component