[Question] How does the expand=True (or int) even work? #2654
Unanswered
angrymidget4728
asked this question in
Q&A
Replies: 1 comment
-
I don't know why but if I added
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I was initially under the impression that the
expand
property is a jacked-up/combined version of certain css properties, and while that is true to some extent, it doesn't seem flexible (assuming I'm using it correctly).The following code gives what I wanted.
But as soon as add content, it shrinks the column to fit the content.
I recognize that this is the same behavior that occurs for
Row()
(since the tabs are in a row) but in such a case it is causing more problems than fix. My immediate thought was to usepage.width
but I realized that wouldn't be the same as the cssvh
measurement that constantly updates according to window size. Is usingpage.width
/page.on_window_event
withpage.update()
my only way or is there a more elegant/built-in way to tackle this using just theexpand
property?EDIT:
As an analogy, practically any element in Figma has three options for both height and width each: fixed width, fill container, hug contents. From my test of Flet, the
expand=True
seems to apply 'fill container' for both height and width of a control when there is no content present. If you add content, then it takes its own liberty to makeheight=fill container
, butwidth=hug contents
(if in a column, and vice versa for row).How do I take control of this behavior with Flet similar to Figma?
Code sample
No response
Error message
No response
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions