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

[🐛 BUG] Changes are not reflected after a reassignment #2460

Open
1 of 7 tasks
FlorianJacta opened this issue Feb 24, 2025 · 0 comments
Open
1 of 7 tasks

[🐛 BUG] Changes are not reflected after a reassignment #2460

FlorianJacta opened this issue Feb 24, 2025 · 0 comments
Labels
🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed

Comments

@FlorianJacta
Copy link
Member

FlorianJacta commented Feb 24, 2025

What went wrong? 🤔

A user has tried to reassigne variable after assigning it through a visual element, but it didn't work. After a refresh of the page, this assignment is seen.

Expected Behavior

This should reassign the variable as the developper wants it. The code works if instead of a string, we try to assign a list.

Steps to Reproduce Issue

The variable should always be "...". After a refresh, "..." appears.

import taipy.gui.builder as tgb
from taipy.gui import Gui, invoke_callback, get_state_id

lov_additional_info = ["...", "Contact", "Methodology", "Training"]
selected_additional_info = lov_additional_info[0]


def select_additional_info(state):
    print(state.selected_additional_info)
    state.selected_additional_info = lov_additional_info[0]
    print(state.selected_additional_info)


with tgb.Page() as page:
    tgb.selector(
        value="{selected_additional_info}",
        id="additional_info_selector",
        lov="{lov_additional_info}",
        label="Click for additional info",
        dropdown=True,
        on_change=select_additional_info,
        class_name="fullwidth m-half",
        # multiple=True,
    )


def on_change(state, var_name, var_value):
    print(var_name, var_value)


Gui(page).run()

Version of Taipy

4.0.2

Additional Context

Acceptance Criteria

  • A unit test reproducing the bug is added.
  • Any new code is covered by a unit tested.
  • Check code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@FlorianJacta FlorianJacta added 💥Malfunction Addresses an identified problem. 🖰 GUI Related to GUI 🟨 Priority: Medium Not blocking but should be addressed labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed
Projects
None yet
Development

No branches or pull requests

1 participant