Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: TextField not working on Linux Mint #3934

Open
1 task done
Birnendampf opened this issue Sep 3, 2024 · 14 comments
Open
1 task done

Regression: TextField not working on Linux Mint #3934

Birnendampf opened this issue Sep 3, 2024 · 14 comments
Labels
bug: regression A feature that worked correctly doesn't anymore has-upstream This issue depends on an upstream issue platform: linux Specific to one or more Linux distributions

Comments

@Birnendampf
Copy link

Birnendampf commented Sep 3, 2024

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.

@Birnendampf
Copy link
Author

Same behavior for SearchBar and CupertinoTextField

@nastiliano
Copy link

Hello,

In my Linux (Mint 22 - Cinamon 6.2.9) they work fine, exept the accents.

If I type something like "Aló", appears "Al´ó" (a first nonesense accent and then the correct one)

Thanks, best regards

@nastiliano
Copy link

Hello,

In my Linux (Mint 22 - Cinamon 6.2.9) they work fine, exept the accents.

If I type something like "Aló", appears "Al´ó" (a first nonesense accent and then the correct one)

Thanks, best regards

Opps... and another strange behaviour.
I can't delete completely their values... Always remains the first character.

If I want to remove "Aló", always remains "A"

@ndonkoHenri
Copy link
Collaborator

I can't delete completely their values... Always remains the first character.

image

https://python.plainenglish.io/whats-new-in-flet-v0-24-0-83f758245f4d

@ndonkoHenri
Copy link
Collaborator

ndonkoHenri commented Sep 4, 2024

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.

Works normally on my Mac. @Birnendampf do you have Linux too?
Please can you guys share a video?

@ndonkoHenri
Copy link
Collaborator

ndonkoHenri commented Sep 4, 2024

Found a Flutter issue related this: flutter/flutter#153560
I subscribed so I get notified on any updates.

@ndonkoHenri ndonkoHenri added platform: linux Specific to one or more Linux distributions bug: regression A feature that worked correctly doesn't anymore labels Sep 4, 2024
@nastiliano
Copy link

I can't delete completely their values... Always remains the first character.

image

https://python.plainenglish.io/whats-new-in-flet-v0-24-0-83f758245f4d

Ok!! Thanks

@Birnendampf
Copy link
Author

Birnendampf commented Sep 4, 2024

Hello,

In my Linux (Mint 22 - Cinamon 6.2.9) they work fine, exept the accents.

also using mint and for you its fine? that's strange, maybe its my system.
I will try upgrading to Mint 22 maybe its the OS

@ShubhamVG
Copy link

ShubhamVG commented Sep 4, 2024

Hello,
In my Linux (Mint 22 - Cinamon 6.2.9) they work fine, exept the accents.

also using mint and for you its fine? that's strange, maybe its my system. I will try upgrading to Mint 22 maybe its the OS

Hello. I was facing this issue too on Mint 22 and I re-installed mint and the issue went away. I don't think it is an OS problem because users using Mint 21.3 or 22 and other versions are also facing this issue flutter/flutter#153560. But this for sure is happening with 3.24.0. Updating your mint might fix this for you as my fresh installation helped me.

@Birnendampf
Copy link
Author

didn't fix it for me sadly, is there any more info I should provide or do we wait until it's fixed upstream?
At the risk of sounding inexperienced, is there a way to use the new version of flet with an old version of flutter?

@nastiliano
Copy link

Hello,

In my Linux (Mint 22 - Cinamon 6.2.9) they work fine, exept the accents.

If I type something like "Aló", appears "Al´ó" (a first nonesense accent and then the correct one)

Thanks, best regards

Hello,

Just now I reviewed it again with Linux (Mint 22 - Cinnamon 6.2.9) and Flet v.0.24.1 and doing the right steps explained at:

https://python.plainenglish.io/whats-new-in-flet-v0-24-0-83f758245f4d

And all works perfect for me, I can't help you sorry.

Thanks, best regards.

@ShubhamVG
Copy link

didn't fix it for me sadly, is there any more info I should provide or do we wait until it's fixed upstream? At the risk of sounding inexperienced, is there a way to use the new version of flet with an old version of flutter?

That is interesting. I did a fresh mint installation so there was no backup involved apart from my old code. Did you use timeshift or something to create a snapshot or backup of either the entire machine or just the home folder? If so, did you install it too before or after installing flutter? I have a hypothesis that nothing from the home directory is causing the flutter TextField to not function properly like a binary or lib*.so from somewhere else. However, I have neither any reasoning to back that up nor any means to try it out at the moment. By the way, did you try to remove your flutter folder and install it again? Ah also, I installed arch linux on my machine before re-installing mint so I was fiddling around with secure boot and other things. Maybe you can try to toggle those around tho' that is very unlikely to work.

@ShubhamVG
Copy link

I have some bad news. I just went to try if TextField is still working on my mint or not and I realized that it is not 😭
When I had my fresh mint installation, everything was working fine. Hmm, maybe I installed or apt autopurge-d something I shouldn't have.

@Birnendampf Birnendampf changed the title Regression: TextField not working on Linux Regression: TextField not working on Linux Mint Sep 17, 2024
@ShubhamVG
Copy link

@Birnendampf and others, I would like to bring your attention to this flutter/flutter#153560 (comment). If you have an urgent project and don't want to downgrade flutter, then you can just change your desktop environment. I am using i3wm for a while and didn't have the textfield issue so far. I tried on KDE Plasma and didn't have issue there either but my KDE setup was not configured or anything i.e., it was the bare minimum KDE setup so cannot say for sure if switching to KDE Plasma is a guaranteed workaround or not but worth a try if it is urgent.

@ndonkoHenri ndonkoHenri added the has-upstream This issue depends on an upstream issue label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: regression A feature that worked correctly doesn't anymore has-upstream This issue depends on an upstream issue platform: linux Specific to one or more Linux distributions
Projects
None yet
Development

No branches or pull requests

4 participants