Making Specific Parts of a Composite Component Non-Selectable/Non-Editable: Is It Possible? #629
Unanswered
johann-taberlet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm attempting to create composite components where only specific parts are editable. Take, for instance, a card component; I want to allow users to edit the text and image areas but prevent them from altering or selecting the surrounding containers that control the layout of the card. This is crucial because I ultimately need to generate the complete HTML for this component, which requires the use of custom UserComponents for the containers.
To achieve this for now, I created a custom props "isEditable" and checked within the RenderNode function whether a component is editable; if not, the parent is selected and so on. This method works to some extent, but it's not ideal, as these components are still visible in the Layer component.
In summary, I need a method to construct composite components where certain parts are neither selectable nor editable, yet they must still be included in the editor state for parsing.
Here is an example of my current solution:
Thanks in advance if anyone has a better idea to address this needs :)
Beta Was this translation helpful? Give feedback.
All reactions