Forum Academy Marketplace Showcase Pricing Features

Toggle between input and text inside RG Cell

I’m trying to toggle visibility between a text and an input inside a RG Cell but can’t figure out how to do that (aggravating factor: I’m pretty sure I’ve done it once before).

Using conditions, I can’t seem to be able to make input invisible when not focused. All other element’s visibility are triggered by input not being focused, except for input itself (so “when this input isn’t focused, this input is visible = NO” doesn’t work).

I tried adding a cell element in the RG cell, but even though the cell value is changed when input isn’t focused, it won’t trigger the workflow to hide that input…

Your Bubble app (11)

What am I doing wrong?

I am honestly not quite sure but I think logically if the item is not focused and hidden then there’s no way to make it focused because you can’t even see it. If I am making sense.
You might try to start an action (when element state is true) and you put the same condition and trigger hide element .

It is focused while in use. Then it is unfocused (see how text on the right changes from “input is focused” to “input is not focused” and so the text value on the right is able to change based on focused state of input. The actual text’s visibility below is also triggered by the input losing focus. Yet the input itself does not become invisible when losing focus. :thinking: At that point it’s visible and out of focus, so it should become invisible.

Yeah I got you.
Could you please try to put the input in a group and try the same condition to hide the group.

Yeah I tried that too. It doesn’t work. Somehow the input’s lack of focus cannot trigger visibility state for itself or its parent.

Did you try custom states? Something like yes and no when the input is focused and then if custom state is yes, show. If No, hide.
Something like this .

Yes but you cannot trigger custom state from a condition. It can only be triggered by a workflow. I even tried adding a third group (called “edit mode”) with a yes/no content which should set to no whenever the input is unfocused, then trigger a workflow whenever the group value goes back to no. Not working either… :slightly_frowning_face:

Well, cause am on my phone now so I will ask from my memory.
Can’t you make a workflow (when element is true) and you can make it only when (input element is not focused) Action >hide/show or set state?
Can’t we do that?

No, if you do a “when condition is true” workflow trigger, you only have hover and visible as option, or custom state. Since custom state can’t be triggered by a condition, then we are back to square 1.

It’s really tricky this one, when I go home I will keep trying for you

1 Like

Hello again bro.
i just got home and tried it and it worked for me.
i just made a button and an input and when u press the button it does : Show input>set focus on input. And in the input i did same condition you have done, when this input is not focused> this input is visible (unchecked).
and it works for me inside rg.

Oh :open_mouth:
Does it also work with a multiline input?

Edit: I just tried again with input and multiline input and it simply won’t work. That’s super weird. :thinking:

Edit 2: I’ve just added both conditions:

  • When this element is focused >> visible
  • When this element isn’t visible >> not visible

That seems to work now. For some reason beyond my understanding, it needs both.

1 Like

Glad it worked

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.