menu

UXPin

Design, prototyping and design systems solution chosen by the best teams.

Channels
# All channels
view-forward
# General
view-forward
# Announcements
view-forward
# Feature requests
view-forward
# Help
view-forward
# Before you post
view-forward
# Learn
view-forward
Team

Can I set multiple elements to the same state in one interaction?

April 1, 2020 at 9:40pm
The UXPin community has a new home. This thread is preserved for historical purposes. The content of this conversation may be innaccurrate or out of date. Go to new community home →

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.
Possible Solutions
  • 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.
Edited
like-fill
1
  • reply
  • like

April 2, 2020 at 8:36am
Screenshots wouldn't help in this case I think.
  • reply
  • like
I need to go to a specific state unfortunately.
  • reply
  • like
But your suggestion to copy the interaction is quite allright. I'll do that for now.
  • reply
  • like
Thanks!
  • reply
  • like
Bert, you could also achieve that if you use a parent - child state structure. Group all of those components and add state eg active to it in this state turn all of the components to wanted state Then just trigger it state change for the whole group with Set state interaction.
  • reply
  • like
I tried that.. didn't work.
  • reply
  • like
At least nog when the children are components.
  • reply
  • like
now.. components and especially nested components have not been working OK the last few weeks/months. Lots of weird behavior.
  • reply
  • like
Ah, my bad. I misunderstood it. Now I see how you have it set up. In this case I'd recommend copying the interaction. You can also use "Next state" interaction, as you only have 2 states for those elements, and in Next state you will be able to pick multiple elements in one interaction
  • reply
  • like

April 13, 2020 at 9:48pm
I'm trying to do the same thing this morning. A "Find" function would be awesome. For example, find all elements named "menu-item" and set the state.
like-fill
1
  • reply
  • like