Skip to content

TextField.value's type hint #591

@ndonkoHenri

Description

@ndonkoHenri

Description

TextField.value can take both a str and a number. But its type hint in textfield.py is Optional[str] = None(either str or None)
The type hint should be updated, if you think this behavior is normal.

Code example to reproduce the issue:

import flet as ft

def main(page: ft.Page):

    tb1 = ft.TextField(value=2500)
    tb2 = ft.TextField(value="2500")

    page.add(tb1, tb2)

ft.app(target=main)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions