Skip to content

Crash in TextField with TextCapitalization.WORDS #4859

Open
@Jorwinnn

Description

@Jorwinnn

Duplicate Check

Describe the bug

When using a TextField in Flet with capitalization=ft.TextCapitalization.WORDS, if the user types three consecutive spaces, the application crashes. Instead, macOS displays a system crash report for the Flet executable.

Code sample

Code
import flet as ft


def main(page: ft.Page):

    # Write 3 spaces in the TextField
    page.add(
        ft.TextField(
            autofocus=True,
            capitalization=ft.TextCapitalization.WORDS,
        ),
    )


ft.app(target=main)

To reproduce

  1. Run the code.
  2. Press the spacebar three times.
  3. The application crashes, and macOS shows an error report.

Expected behavior

The application should not crash. Instead, it should allow multiple spaces without issues, or at least handle the input safely.

Screenshots / Videos

Captures

Crash Screenshot

Operating System

macOS

Operating system details

Big Sur 11.7.10

Flet version

0.26.0

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
No Python traceback was generated.

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions