Skip to content

Wrong behavior using both alignment & expand=False in Container #5209

@Michel7GitHub

Description

@Michel7GitHub

Duplicate Check

Describe the bug

Using alignment and expand=False in Container give me an unexpected result.
I want my Container not to expand.
In the following example, the first Container give me an expected result (without alignment).
Then, I want to align the text, and the second Container give me an expanded Container.
Is this normal ?

import flet as ft

def main(page: ft.Page):
    page.add( 
        ft.Container(
            ft.Column(
                [
                    ft.Container( ft.Text("Hello"), expand=False, height=50, bgcolor='amber' ),
                    ft.Container( ft.Text("Hello"), expand=False, height=50, bgcolor='orange', alignment=ft.alignment.center_left ),
                ]
            )
        )
    )

ft.app(target=main)

Code sample

see above

To reproduce

Execute sample code

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 11

Flet version

0.27.6

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions