Skip to main content
Participant
June 9, 2020
Question

Combining multiple components breaks component inheritance

  • June 9, 2020
  • 1 reply
  • 629 views

I'm on the latest version of XD at this moment : 29.3.32.3


My Issue:
I've got multiple master components which make use of each other.

  • TextBox : just a box on which I only use for it's height and radius.
  • Field Text : Makes use of TextBox for it's containing box. It sets custom colors for the TextBox it uses and adds text.
  • Field DropDown : Makes use of Field Text but adds a dropdown arrow

Works fine when:

  • creating all these different components everything works as expected;
  • creatign slave implementations of these components and correctly allows me to update colors sizes etc;

But then when you need to update one of the composed masters it stops working.
Example:
When updating master of Field Text and updating one of the colors of TextBox none of the slaves of Field Text get updated.
Note that they did correctly take over updated colors when the master component was created.

This leads me to believe that the internal logic of how master components are handled work incorrectly.
When changing a master component which makes use of other components it does not propegate those changes to it's children. Instead it seems to see that change as a specific change to that 1 component on your artboard (which should not be happening on a master component).
Aka it saves the changes in the wrong location in the file in artwork/...board../graphicsContent.agc insteadof in resources\graphics\graphicContent.agc.

I hope this is enough information for you to fix the problems with components using other components.

P.S.
*Yes I broke open the file to see it's internal workings as it's just a zipped file with some json data.
** I was shocked to see that everytime a Slave of a Master Component is made that the the entire object graph is copy pasted for each and every instance instead of just overwritting the object properties the Slave changes (doing this would have made component inhertitance easier to implement and also would tremendously reduse the file size when making use of components).

This topic has been closed for replies.

1 reply

Community Manager
June 10, 2020

Hello C_Duivis, 

Looks interesting what you are trying to do. 

Can you please help me in knowing more what you are trying to do and how. 

It will be great if you can attach video, will be easy to catch issue in XD if it is.

 

Thanks, 

Vertika Gupta

Adobe XD