Design, prototyping and design systems solution chosen by the best teams.
Can I set multiple elements to the same state in one interaction?April 1, 2020 at 9:40pm
I have multiple components with an inner state. I would like to set all these components to the same state on an interaction. Unfortunately I can't select multiple elements in the 'set state' action.
As a workaround I tried to group all the elements and add a top state which triggers the embedded states. That doesn't work either.
Any tips? Thanks.
April 1, 2020 at 11:43pm
It may help the community if you posted a few screen shots of how you have your components set up.
If you are simply trying to tell multi-state elements or components to go to the NEXT or PREVIOUS state you should be able to do this. If you are trying to tell multi-state elements or components to go to a specific named state then you won't be able to do this with a single interaction.
- You can however do this with duplicated interactions in the button where you simply target the specific the multi-state component and then target the specific state.
- Using variables to control actions. Without seeing how your prototype is set up, you can set the button interaction to change a variable from false "0" to true "1" to then have a page interaction control the states of components. Such as var controlsDisabled = 0 to allow all controls to be enabled. controlsDisabled set to 1 or true would then trigger a page-level interaction with conditional statements to listen for a variable change for "controlsDisabled". If 1 or true, then do X. Again, you could only control multiple components with a nextState or previousState interaction.
April 2, 2020 at 8:36am
I need to go to a specific state unfortunately.
But your suggestion to copy the interaction is quite allright. I'll do that for now.
At least nog when the children are components.
now.. components and especially nested components have not been working OK the last few weeks/months. Lots of weird behavior.
April 13, 2020 at 9:48pm