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: 2 comments
-
@johann-taberlet have u found solution? Just met the same problem. I actually tried removing the "connect" on
And the result is that when you move ChildC or ChildD there will be an error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Remove ref > connect conditionally to make elements non-editable. |
Beta Was this translation helpful? Give feedback.
0 replies
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