Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
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):
- run code
- select text field
- try to type (no text appears, nothing is being printed)
- try to hit enter (nothing is being printed)
- try to close window
Expected behavior
at step 3: text is being entered
at step 5: the window closes
Screenshots / Videos
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status