flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.55k stars 452 forks source link

Setting `TextField.max_length` should not display the counter by default #4273

Closed ndonkoHenri closed 3 days ago

ndonkoHenri commented 3 weeks ago

I'm using a Textfield, and I want to limit the characters to 15, but I dont want to see the counter under the Textfield. I'm trying to delete using counter_text = None or '', but still appearing. In the documentation, show a property called counter, but it doesn't exist. Im using flet = 0.21.2. How can I delete this. Thanks image

Code sample

ft.TextField(
            label="Motivo",
            expand=2,
            visible=False,
            on_change=self.mensaje,
            max_length=15,
            counter_text='',
            input_filter=ft.TextOnlyInputFilter(),
            capitalization="CHARACTERS"
        )

Originally posted by @ingdesarr1 in https://github.com/flet-dev/flet/discussions/4224

headhunter5437 commented 2 weeks ago

I'm Pretty new to coding in general so im not sure if this will work for you but it did for me

counter_style=TextStyle(height=-1, color="surface,0")

japr99 commented 1 day ago

work for me.

counter_style=ft.TextStyle(size=0)

ndonkoHenri commented 18 hours ago

Issue has been fixed in the latest prerelease. The counter text is no longer displayed by default.