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

Fix Selector Height for Radio/Check Mode #2425

Merged
merged 8 commits into from
Jan 27, 2025

Conversation

Satoshi-Sh
Copy link
Contributor

@Satoshi-Sh Satoshi-Sh commented Jan 23, 2025

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

The height property doesn't work on Radio and Check mode. I updated the Selector component and added styling with sx. I added a unit test for that.

Related Tickets & Documents

How to reproduce the issue

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

selected_envs = ["env1"]
env_list = [f"env{i}" for i in range(10)]

with tgb.Page() as page:
    tgb.selector(
        value="{selected_envs}",
        lov="{env_list}",
        multiple=True,
        height="150px",
        filter=True,
    )
    tgb.text("Radio mode")
    tgb.selector(
        value="{selected_envs}",
        lov="{env_list}",
        height="150px",
        mode="radio",
    )
    tgb.text("Check mode")
    tgb.selector(
        value="{selected_envs}",
        lov="{env_list}",
        height="150px",
        mode="check",
    )

Gui(page).run()

The height of the selector doesn't work on the Radio and Check mode.

After fix:
radio-check-demo

Checklist

We encourage you to keep the code coverage percentage at 80% and above.

  • This solution meets the acceptance criteria of the related issue.
  • The related issue checklist is completed.
  • [] This PR adds unit tests for the developed code. If not, why?
  • End-to-End tests have been added or updated. If not, why?
  • The documentation has been updated, or a dedicated issue created. (If applicable)
  • The release notes have been updated? (If applicable)

@FabienLelaquais FabienLelaquais added GUI: Front-End 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon labels Jan 24, 2025
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
For homogeneity sake, I would have used double quotes for all string literals though.
Thanks!

Copy link
Member

@FredLL-Avaiga FredLL-Avaiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better return undefined than {}

frontend/taipy-gui/src/components/Taipy/Selector.tsx Outdated Show resolved Hide resolved
Copy link
Member

@FredLL-Avaiga FredLL-Avaiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well done, tx @Satoshi-Sh

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@FredLL-Avaiga FredLL-Avaiga merged commit 5f84c83 into Avaiga:develop Jan 27, 2025
132 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: Front-End 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The hight properties in the Selector visual element, in mode='radio' does not work.
3 participants