flet-dev / flet-dev/flet

Regression: TextField not working on Linux Mint

Open
#3,934 22 comments 0 reactions 1 assignee View on GitHub

@ndonkoHenri is already working on this.

Since Nov 25, 2024.

bug: regression has-upstream platform: linux
Dominant language
Python
Stars
17k
Forks
694
Avg merge
1d 14h
Merged PRs (30d)
33

Description

Duplicate Check
Describe the bug

When trying to use a TextField, it is not possible to input text, and the window stops being closeable as soon as the TextField is focused.
Any other interaction also fails when the TextField is focused. Flet becomes completely unresponsive.

Code sample
Code
import flet as ft


async def main(page: ft.Page):
    field = ft.TextField(on_change=print, on_submit=print)
    page.add(field)


ft.app(main)
To reproduce

On linux (in my case mint):

  1. run code
  2. select text field
  3. try to type (no text appears, nothing is being printed)
  4. try to hit enter (nothing is being printed)
  5. try to close window
Expected behavior

at step 3: text is being entered
at step 5: the window closes

Screenshots / Videos

after resize

state of Flet window after focusing the text field and resizing

Operating System

Linux

Operating system details

Linux Mint 21.3 Cinnamon

Flet version

0.24.0

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs
Logs when run with debug level logging, and executing the steps to reproduce:
DEBUG:asyncio:Using selector: EpollSelector
INFO:flet_runtime:Assets path configured: /home/[username]/.config/JetBrains/PyCharm2024.1/scratches/assets
DEBUG:flet_core:Creating new PubSubHub instance
DEBUG:flet_core:Creating new PubSubHub instance
INFO:flet_runtime:Starting up UDS server on /tmp/OK1ms9Ei21
INFO:flet_runtime:Flet app has started...
INFO:flet_runtime:App URL: /tmp/OK1ms9Ei21
INFO:flet_runtime:Starting Flet View app...
INFO:flet_runtime:Flet View found in: /home/[username]/.flet/bin/flet-0.24.0
package:media_kit_libs_linux registered.
DEBUG:flet_runtime:Connected new TCP client
DEBUG:flet_runtime:_on_message: {"action":"registerWebClient","payload":{"pageName":"tmp/OK1ms9Ei21","pageRoute":"/","pageWidth":"1280.0","pageHeight":"720.0","windowWidth":"1280.0","windowHeight":"720.0","windowTop":"25.0","windowLeft":"1945.0","isPWA":"false","isWeb":"false","isDebug":"false","platform":"linux","platformBrightness":"dark","media":"{\"padding\":{\"top\":0.0,\"right\":0.0,\"bottom\":0.0,\"left\":0.0},\"view_padding\":{\"top\":0.0,\"right\":0.0,\"bottom\":0.0,\"left\":0.0},\"view_insets\":{\"top\":0.0,\"right\":0.0,\"bottom\":0.0,\"left\":0.0}}","sessionId":""}}
DEBUG:flet_runtime:__send: {"action":"registerWebClient","payload":{"session":{"id":"","controls":{"page":{"i":"page","t":"page","p":"","c":[],"route":"/","width":"1280.0","height":"720.0","windowwidth":"1280.0","windowheight":"720.0","windowtop":"25.0","windowleft":"1945.0","pwa":"false","web":"false","debug":"false","platform":"linux","platformBrightness":"dark","media":"{\"padding\":{\"top\":0.0,\"right\":0.0,\"bottom\":0.0,\"left\":0.0},\"view_padding\":{\"top\":0.0,\"right\":0.0,\"bottom\":0.0,\"left\":0.0},\"view_insets\":{\"top\":0.0,\"right\":0.0,\"bottom\":0.0,\"left\":0.0}}"}}},"error":"","appInactive":false}}
DEBUG:flet_core:_process_command: get ['page', 'route'] {}
DEBUG:flet_core:_process_command: get ['page', 'pwa'] {}
DEBUG:flet_core:_process_command: get ['page', 'web'] {}
DEBUG:flet_core:_process_command: get ['page', 'debug'] {}
DEBUG:flet_core:_process_command: get ['page', 'platform'] {}
DEBUG:flet_core:_process_command: get ['page', 'platformBrightness'] {}
DEBUG:flet_core:_process_command: get ['page', 'media'] {}
DEBUG:flet_core:_process_command: get ['page', 'width'] {}
DEBUG:flet_core:_process_command: get ['page', 'height'] {}
DEBUG:flet_core:_process_command: get ['page', 'windowWidth'] {}
DEBUG:flet_core:_process_command: get ['page', 'windowHeight'] {}
DEBUG:flet_core:_process_command: get ['page', 'windowTop'] {}
DEBUG:flet_core:_process_command: get ['page', 'windowLeft'] {}
DEBUG:flet_core:_process_command: get ['page', 'clientIP'] {}
DEBUG:flet_core:_process_command: get ['page', 'clientUserAgent'] {}
INFO:flet_runtime:App session started
DEBUG:flet_core:_process_command: add [] {'to': 'page', 'at': '0'}
DEBUG:flet_core:_process_command: add [] {'to': 'page', 'at': '1'}
DEBUG:flet_runtime:__send: {"action":"pageControlsBatch","payload":[{"action":"addPageControls","payload":{"controls":[{"t":"view","i":"_1","p":"page","c":["_2"],"at":"0"},{"t":"textfield","i":"_2","p":"_1","c":[],"onchange":"true"}],"trimIDs":[]}},{"action":"addPageControls","payload":{"controls":[{"t":"offstage","i":"_3","p":"page","c":[],"at":"1"}],"trimIDs":[]}}]}
DEBUG:flet_runtime:sent to TCP: 604
DEBUG:flet_runtime:sent to TCP: 347
DEBUG:flet_runtime:_on_message: {"action":"pageEventFromWeb","payload":{"eventTarget":"_2","eventName":"focus","eventData":""}}
DEBUG:flet_core:page.on_event_async: _2 focus 
DEBUG:flet_runtime:Gracefully terminating Flet app...
DEBUG:flet_runtime:Flet View process 6056
DEBUG:flet_runtime:Closing connection...
DEBUG:flet_runtime:Disconnecting all pages...
DEBUG:flet_core:page.on_event_async: page disconnect 
DEBUG:flet_runtime:Shutting down thread pool...

Process finished with exit code 0
Additional details

This is a new regression with 0.24.0, it used to work in 0.23.2.
I have tested both versions after each other to make sure the issue is not caused by anything else.
I have also tested the code sample on windows and macOS, it works just fine there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.