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] Slider with tuple lov forced into multi-selection #2376

Open
1 of 7 tasks
arcanaxion opened this issue Jan 3, 2025 · 0 comments
Open
1 of 7 tasks

[🐛 BUG] Slider with tuple lov forced into multi-selection #2376

arcanaxion opened this issue Jan 3, 2025 · 0 comments
Labels
💥Malfunction Addresses an identified problem.

Comments

@arcanaxion
Copy link

arcanaxion commented Jan 3, 2025

What went wrong? 🤔

Previous demonstrated this in #2290.

Code example:

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

aggregation_list = [("minute", "Minute"), ("hour", "Hour"), ("day", "Day"), ("week", "Week")]
selected_aggregation = aggregation_list[0]

with tgb.Page() as page:
    tgb.text("# Single selection for list[tuple[str, str | Icon]] lov", mode="md")
    tgb.slider("{selected_aggregation}", lov="{aggregation_list}", value_by_id=False)
    tgb.text("{selected_aggregation}")

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

if __name__ == "__main__":
    gui = Gui(page=page)
    gui.run(run_browser=False, use_reloader=True)

Video:

slider.tuple.lov.multi.selection.mp4

Expected Behavior

Slider should be single-select.

For multi-selection, selected_aggregation should have been initialized to a list (e.g. [] or aggregation_list[:2]).

Browsers

Chrome

OS

Windows, Linux

Version of Taipy

develop

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)
@arcanaxion arcanaxion added the 💥Malfunction Addresses an identified problem. label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥Malfunction Addresses an identified problem.
Projects
None yet
Development

No branches or pull requests

1 participant