Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
10.94k stars 775 forks source link

[🐛 BUG] tgb.toggle("{value}") does not work but tgb.toggle(value="{value}") works #1315

Closed AlexandreSajus closed 3 months ago

AlexandreSajus commented 3 months ago

What went wrong? 🤔

From Stack Overflow

With this code, toggle does not move:

from taipy.gui import Gui
import taipy.gui.builder as tgb

def on_toggle(state):
    print("toggled")

value = False

with tgb.Page() as page:
    tgb.toggle("{value}", on_change=on_toggle)

if __name__ == "__main__":
    Gui(page).run(debug=True)

It works when I replace the toggle with:

tgb.toggle(value="{value}", on_change=on_toggle)

Expected Behavior

No response

Steps to Reproduce Issue

No response

Solution Proposed

No response

Screenshots

No response

Runtime Environment

No response

Browsers

No response

OS

No response

Version of Taipy

No response

Additional Context

No response

Acceptance Criteria

Code of Conduct

FlorianJacta commented 3 months ago

This is a known error. This should have been fixed: https://github.com/Avaiga/taipy/issues/994 https://github.com/Avaiga/taipy/issues/1218

Could you test it and close it if it works on develop?

AlexandreSajus commented 3 months ago

Indeed fixed in develop