flet icon indicating copy to clipboard operation
flet copied to clipboard

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

Open ndonkoHenri opened this issue 2 years ago • 3 comments

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

ndonkoHenri avatar Oct 31 '24 12:10 ndonkoHenri

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")

headhunter5437 avatar Nov 06 '24 06:11 headhunter5437

work for me.

counter_style=ft.TextStyle(size=0)

japr99 avatar Nov 25 '24 10:11 japr99

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

ndonkoHenri avatar Nov 25 '24 19:11 ndonkoHenri