Skip to main content
Solved

Textvariant not setting correctly with variable on switch

  • January 9, 2024
  • 2 replies
  • 187 views

Martijn_Benschop

Hi guys,

i have an ON/OFF switch. When clicked it should change a text (connected to a variable) to ON or OFF and the button itself must change its variant accoringly. What ends up happening is that the text does switch from ON → OFF when i click (GOOD). But the text will not change back to ON again when the switch is in its OFF-variant (NEEDS FIXING) and is clicked.
The text does change from OFF-> ON again when the switch is in it’s ON-state, but i end up with an OFF switch with ON-text.

I have made a video to show what i mean:
Video

Here is the component and its interactions (the switch state-off which should set the variable to ON):

I have made multiple iterations, also with conditional interactions, but i end up with the same problem. It’s getting frustrating to fix. Does someone have a solution for this?

Best answer by Martijn_Benschop

I solved it by setting the variant directly to true in this way:

image

I guess it’s sometimes better to type what you want than to click on the Figma UI.

This topic has been closed for replies.

2 replies

Martijn_Benschop

Here is the switch in state ON:


Martijn_Benschop

I solved it by setting the variant directly to true in this way:

image

I guess it’s sometimes better to type what you want than to click on the Figma UI.