Binding On Click Workflow on checkbox prevents/interrupts checkbox from being marked/unmarked

I have a Workflow that responds to the On Click for a checkbox.

When clicking the checkbox for the first time, it doesn’t toggle the checkbox value, but it does trigger the event (I can see it only the logs)

This only happens on the first click. After that, the checkbox works as expected.

CleanShot 2024-06-27 at 23.52.47

Are you changing that checkbox value inside the onClick? That might cause a similar behavior.

If not try setting the workflow to ‘On change’ or ‘On Init value change’

Hi again, @Miguel!

Thanks for the help.

All I’m doing in the workflow is calling a component action. Here’s a screenshot.

I don’t see the ‘on change’ or ‘on init value change’ as an option. It sounded like a great idea, though! Maybe I’m missing something…

Yikes!

So I was setting the workflow on the actual checkbox HTML element and not on the checkbox “component.”

Setting it on the component gives you access to those additional actions you mentioned (“On change” and “On init value change”).

So for future reference if anyone is wondering…

The joys of learning the nuances of a new tool! So many simple things to learn that block you. I’ll get there though!

Thanks @Miguel !

You’re welcome, It happens to the best of us haha! Yes you will only get ‘On change’ and ‘On Init value change’ if is a input element.

Good work!

1 Like

Thanks @Miguel!

In case you were wondering, I originally marked your response as the solution, but then I thought it might be confusing for someone who had a similar question not to see the way to fix it, so I marked my post as the solution for that purpose and for everyone’s benefit.

All kudos go to you, though!

1 Like

Hi Miguel,

I thought to ask this question here rather than creating a new topic, because it’s similar.

I’m repeating the same design pattern for another user interface. It’s a list of checkboxes — one for each record coming from the database.

I have a workflow for the “on init value” event, but it doesn’t fire.
When I change the event to the “on change”, it fires.

As far as I can tell, it’s the same implementation as before, just being applied to a different list.

The “On Init value change” only seem to trigger when the data/variable that is bind to the “Init value” of the check box element changes

“On change” will trigger every time the checkbox changes, same as “On click”