fastn icon indicating copy to clipboard operation
fastn copied to clipboard

Conditional attribute don't work with the `$on-click$` attribute

Open siddhantk232 opened this issue 1 year ago • 0 comments

-- string $val: click me

-- optional string $msg:

-- ftd.text: $val
$on-click$: ftd.set-string($a = $msg, v = I'll be called)
$on-click$ if { msg != NULL }: ftd.set-string($a = $msg, v = some other message)
$on-click$ if { msg == NULL }: ftd.set-string($a = $msg, v = some message)
$on-click$: ftd.set-string($a = $val, v = the last click event handler)

-- ftd.text: $msg
if: { msg }

Seems like the $on-click$ does not support conditionals. The above snippet will execute all the click handlers in order. You can change the order of the middle two $on-click$, the value of $msg will be equal to whatever is set by the last click handler ("some message" for the above snippet)

siddhantk232 avatar Jun 06 '24 07:06 siddhantk232