Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
siddhantk232 opened this issue Jun 6, 2024 · 0 comments
Open

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

siddhantk232 opened this issue Jun 6, 2024 · 0 comments

Comments

@siddhantk232
Copy link
Contributor

-- 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant