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

feat: Add {value_length}, {max_length}, and {symbols_left} placeholders to TextField.counter_text #4403

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Nov 20, 2024

Closes #1534

Test Code

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.TextField(
            hint_text="Custom counter text",
            counter_text="{value_length} chars / {max_length} max chars / {symbols_left} symbols left",
            max_length=10,
        ),
        ft.TextField(
            hint_text="Counter text isn't shown by default anymore",
            max_length=20,
        ),
    )


ft.app(main)

Summary by Sourcery

Add new placeholders to TextField.counter_text for dynamic character count display, enhancing the user interface with real-time feedback on text input length.

New Features:

  • Introduce placeholders {value_length}, {max_length}, and {symbols_left} in TextField.counter_text to dynamically display character count information.

Enhancements:

  • Modify buildInputDecoration to support dynamic counter text with new placeholders.

@FeodorFitsner FeodorFitsner merged commit 4a3ccbb into main Nov 22, 2024
3 checks passed
@FeodorFitsner FeodorFitsner deleted the ndonkoHenri/textfield-counter-text branch November 22, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants