Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#6647·flet

Bug: ft.Text/ft.TextField content not visible when inside Column with expand on Windows Desktop & Web

Author: korporhtCreated Jul 6, 2026Updated Sep 15, 2026

Bug: ft.Text / ft.TextField content not visible inside Column with expand on Windows Desktop & Web

Environment

  • Flet version: 0.85.3 (also tested 0.85.2, 0.86.0.dev1)
  • Python version: 3.14.3
  • OS: Windows 11 Home
  • Desktop client: flet-desktop 0.85.3
  • Web browser: Chrome 149

Description

When ft.Text or ft.TextField (multiline, read_only) is placed inside a ft.Column with expand=True, the text content is not visible. The Container's background color renders correctly (showing a gray area), but the text content remains invisible.

This happens in both Desktop mode (ft.run()) and Web mode (ft.app(view=ft.AppView.WEB_BROWSER)).

Minimal Reproduction

python
import flet as ft

def main(page: ft.Page):
    page.title = "Text Rendering Test"
    page.add(
        # Test 1: Plain Text in Container
        ft.Container(
            content=ft.Text("HELLO TEXT", size=20, color="green", selectable=True),
            bgcolor="#e0e0e0", padding=20,
        ),
        # Test 2: Container with expand=True in Column
        ft.Container(
            content=ft.Column(
                controls=[
                    ft.Text("Header", size=16),
                    ft.Container(
                        content=ft.Text("CONTENT INSIDE EXPANDED COLUMN", color="red"),
                        expand=True,
                        bgcolor="#EEEEEE",
                        padding=10,
                    ),
                ],
                expand=True,
            ),
            height=300,
            padding=10,
        ),
        # Test 3: TextField multiline read_only
        ft.TextField(
            value="LINE 1\nLINE 2\nLINE 3",
            multiline=True,
            read_only=True,
            min_lines=5,
            text_style=ft.TextStyle(size=14, color="blue"),
        ),
    )
    page.update()

ft.run(main)

Expected: Green, red, and blue text visible in all three test areas. Actual: Only the Container background renders (gray/light areas visible). All text content is invisible.

Debug Logs

Flet transport debug log confirms the data IS sent correctly:

2026-07-06 15:23:04 [INFO] log_tab: [_append_log] line=应用启动完成, total=2
2026-07-06 15:23:04 [INFO] log_tab: [_do_update_text] ENTER, thread=ThreadPoolExecutor-0_0
2026-07-06 15:23:04 [INFO] log_tab: [_do_update_text] update complete OK

No Python-side errors during normal operation. Flet WebSocket binary messages (msgpack) show the correct value being transmitted:

TextField(_i=29, ... value='就绪 - 等待操作…', multiline=True, read_only=True, ...)

Debug Messages Sent

The initial page build correctly includes:

  • Container bgcolor='#1E1E1E' (renders)
  • TextField value='就绪 - 等待操作…' (sends correctly, but not rendered)

Subsequent updates via page.run_thread(update_method) also complete without error:

[_do_update_text] ENTER, thread=ThreadPoolExecutor-0_0
[_do_update_text] update complete OK

Attempted Workarounds (none worked)

Approach Result
ft.Text(value=...) Not visible
ft.Text(selectable=True) Not visible
ft.ListView(controls=[ft.Text(...)]) Not visible
ft.Column(scroll=AUTO) Not visible
ft.TextField(multiline=True, read_only=True) Not visible
ft.Container(content=Text(...), expand=True) Not visible
Fixed height instead of expand=True Not visible
build_controls_on_demand=False Not visible
item_extent=20 Not visible
Replacing Container content entirely Not visible
Updating Text value in-place Not visible
Upgraded 0.85.2 → 0.85.3 → 0.86.0.dev1 Not visible
Web mode (ft.app(view=WEB_BROWSER)) Not visible
flet run --web Not visible

Additional Error (Post-disconnect)

After WebSocket disconnection, page.run_thread() crashes:

python
File "page.py", line 841, in run_thread
    loop = self.session.connection.loop
AttributeError: 'NoneType' object has no attribute 'loop'

Related Issues

  • #3931 ListView on-demand controls build
  • #6585 NavigationRail inside Row causes blank screen on Windows 0.84.0/0.85.3

Notes

  • ft.ElevatedButton, ft.Switch, ft.Dropdown, ft.NavigationRail, ft.IconButton all render correctly
  • Only text-based controls (ft.Text, ft.TextField) fail to render
  • The Container's bgcolor and border render correctly, confirming layout calculations work
  • The Flet WebSocket binary protocol confirms all values are transmitted to the client
  • Both Flutter Native (Desktop) and Flutter WASM (Web) clients exhibit the same behavior
  • Suspected root cause: Flutter widget tree rebuild failure for text controls when inside Expand layout

Source: flet-dev/flet

View original on GitHubView discussion on GitHub