Trigger `On Delay` action with boolean logic

Curious if anyone has hit this issue.

I have an interactive component that has multiple On delay steps to simulate a typing animation. The instance of this component is hidden with a boolean variable by default. When I create a button element that switches the visibility boolean to true, the component displays, but the On delay does not trigger.

Is this intended? Workarounds? Any ideas :slight_smile:

2 Likes

Looks like a bug @Guy_Meyer1 . I have raised a similar issue and tagged this post. You can track the issue while @y_toku is looking into it.

1 Like

Hi @Guy_Meyer1, thank you for reaching out. I appreciate your input, @N.A.G.A ! On this issue I’m working closely with Toku.

@Guy_Meyer1, could you please provide a quick video recording of the issue you’re encountering, as well as a copy of your file if possible?

This will greatly assist us in visualizing the issue and determining if it’s related to the one @N.A.G.A mentioned. Additionally it will help us try to reproduce the same behavior in order to gain further insight.

Thank you all for your collaboration and assistance!

Hey @Junko3, here is a screen recording I quickly made as I just ran into this problem as well. The two boxes in the video are both instances of the same component with no changes made to either of them, besides that the box on the left is linked to a boolean variable that is made true by clicking the button.

Edit: Also wanted to throw out there that I tried nesting the On Delay interaction inside the component (instead of making it top level) and that didn’t fix anything, either

Hi there,

Could you please contact our support team as following?

Thanks for your understanding,
Toku

I’ve run into this issue multiple times, and have a workaround that seems to work in most cases, though sometimes it involves some extra steps. The workaround hinges on a “Navigate to” or “Open overlay” action. Either of these actions will jump-start any nested “After delay” interactions that aren’t firing.

In simple cases, such as the demo from @Alex_R above, you can do this:

  1. Create a small invisible frame with a single “After delay” interaction that closes the overlay after 1ms.
  2. Add an “Open overlay” action that opens your invisible frame to the click or other interaction that shows the problematic component.

In more complex cases, you may need to create a polling component that opens your invisible frame every 1000ms or so. This way, any nested “After delay” interactions that aren’t working will be jump-started on a regular basis. The caveat is that this will interrupt any “After delay” timers that are working, so you may need to increase the polling time so that everything has a chance to run before being jump-started.

Here’s how you would do that:

  1. Create a component (again, a small/invisible square is ideal).
  2. Add an “After delay” interaction that opens your invisible overlay after 1000ms.
  3. Add an instance of this component to any screen that you want to poll on.

This works despite the “After delay” action being nested because the action of opening the overlay will reset the timer.

Lastly, you can also do this trick with “Navigate to” and “Back”.

Here’s a file that shows both the simple and polling approaches, using an overlay: Jump-start prototype.fig (47.5 KB)

2 Likes

THANK YOU for this workaround. This has been driving me crazy for a week.