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] Bug: Selector Control Renders Full-Width and Blocks Horizontal Alignment in Taipy 4.0.2 #2458

Open
1 of 7 tasks
cscottgraham opened this issue Feb 23, 2025 · 5 comments
Labels
💬 Discussion Requires some discussion and decision 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed ❓ Question Can be unblocked with an answer

Comments

@cscottgraham
Copy link

cscottgraham commented Feb 23, 2025

What went wrong? 🤔

In Taipy 4.0.2, the selector control (e.g., <|{value}|selector|...|width=120px|> in a <|layout|> or <|part|> with flex) renders as a full-width block element, ignoring width settings (e.g., width=70px, width=120px) and preventing horizontal alignment with input controls in layouts like columns or flex. This forces selector elements to occupy separate lines, even with flex-direction:row or max-content.

Provide steps to reproduce:
Create a Taipy GUI with mixed input and selector controls, e.g.:

Wrap
Copy
from taipy.gui import Gui

first_name = ""
status = None

statuses = ["Open", "Closed", "Pending"]

page = """
<|layout|columns=2|
<|{first_name}|input|label=First Name|width=120px|>
<|{status}|selector|lov={statuses}|dropdown|label=Status|width=120px|>
|>
"""

if __name__ == "__main__":
    Gui(page).run(title="Test Layout")

Observe that "First Name" (input) stays at 120px on one line, but "Status" (selector) renders full-width on a separate line, ignoring width=120px.
Include your environment: “Taipy 4.0.2, Python 3.x, Windows 10, using pip install taipy==4.0.2.”
Mention the impact: “This limitation prevents compact, one-line layouts for forms mixing input and selector, requiring workarounds like multi-line layouts or full-width selectors.

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)
@cscottgraham cscottgraham added the 💥Malfunction Addresses an identified problem. label Feb 23, 2025
@FlorianJacta
Copy link
Member

This is what I get:

Image

Can you tell me what the issue is?

Also, if you want to have two columns in your layout, you should define it like that:

page = """
<|layout|columns=1 1|
<|{first_name}|input|label=First Name|width=120px|>
<|{status}|selector|lov={statuses}|dropdown|label=Status|width=120px|>
|>
"""

@FlorianJacta FlorianJacta added ❓ Question Can be unblocked with an answer 🟨 Priority: Medium Not blocking but should be addressed 💬 Discussion Requires some discussion and decision 🖰 GUI Related to GUI labels Feb 24, 2025
@cscottgraham
Copy link
Author

cscottgraham commented Feb 24, 2025 via email

@cscottgraham
Copy link
Author

cscottgraham commented Feb 24, 2025 via email

@FlorianJacta FlorianJacta changed the title [🐛 BUG] <write a small description here> [🐛 BUG] Bug: Selector Control Renders Full-Width and Blocks Horizontal Alignment in Taipy 4.0.2 Feb 24, 2025
@FlorianJacta
Copy link
Member

FlorianJacta commented Feb 24, 2025

Ok, I see.

Try this code:

from taipy import Gui

first_name = ""
statuses = ["Active", "Inactive", "Pending"]
status = "Active"

page = """
<|layout|columns=120px 120px 1|
<|{first_name}|input|label=First Name|width=120px|>

<|{status}|selector|lov={statuses}|dropdown|label=Status|width=120px|>
|>
"""

if __name__ == "__main__":
    gui = Gui(page)
    gui.run(title="Taipy Layout Test", debug=True)

@FabienLelaquais @FredLL-Avaiga I think this should be fixed. Inputs and selectors should have the same behavior

@cscottgraham
Copy link
Author

cscottgraham commented Feb 24, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 Discussion Requires some discussion and decision 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed ❓ Question Can be unblocked with an answer
Projects
None yet
Development

No branches or pull requests

2 participants