Open PGimenez opened 5 months ago
Updated codebase:
using GenieFramework
@genietools
@app begin
@out vowels=["a","b","c","d"]
@in selected_vowels = ["a", "b"]
@in N = 1
@in trigger = false
@out message = "Hello, World!"
@onchange trigger begin
println("Trigger clicked")
# selected_vowels = selected_vowels
# N = N
message = "Button clicked. N = $N, selected vowels = $selected_vowels"
end
@onchange selected_vowels begin
println("Vowel selected")
# selected_vowels = selected_vowels
# N = N
message = "Vowel selected. N = $N, selected vowels = $selected_vowels"
end
@onchange N begin
println("Number picked")
# selected_vowels = selected_vowels
# N = N
message = "Number picked. N = $N, selected vowels = $selected_vowels"
end
end
ui() = [
p("{{selected_vowels}}, {{N}}")
p("{{message}}")
select(:selected_vowels, options=:vowels, var":multiple"="true")
slider(1:1:10,:N)
btn("Trigger", @click("trigger = !trigger"))
]
@page("/", ui)
This is now fixed but with more of a hack fix in GenieBuilder. The actual problem seems to have been introduced in Stipple 0.28 but will require more time to debug.
The issue is that when a handler is triggered, only the variable attached to the handler has its value updated - all others are reset to the initial values. This only happens in GB, if you run the app from the REPL with
Genie.loadapp()
it works fine.Here's a video describing the issue: https://www.dropbox.com/t/9lPvnBmjVURgbQ9m
and the code to reproduce it: