Skip to content

Comments

feat: Add ignore_up_down_keys to TextField and CupertinoTextField to opt-out of default arrow-key caret jumps#6183

Merged
FeodorFitsner merged 5 commits intomainfrom
textfield-ignore-up-down-keys
Feb 19, 2026
Merged

feat: Add ignore_up_down_keys to TextField and CupertinoTextField to opt-out of default arrow-key caret jumps#6183
FeodorFitsner merged 5 commits intomainfrom
textfield-ignore-up-down-keys

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Feb 18, 2026

Fix #1423

Summary by Sourcery

Introduce an option on text fields to suppress default up/down arrow key caret movement while centralizing key handling logic for submit behavior.

New Features:

  • Add an ignore_up_down_keys configuration flag to TextField and CupertinoTextField to disable arrow-up and arrow-down caret jumps when enabled.

Enhancements:

  • Refactor text field key handling into a shared handler that also manages Enter-based submit behavior for focused fields.

Documentation:

  • Document the new ignore_up_down_keys option on the Python TextField control, explaining its effect on arrow key behavior.

@ndonkoHenri ndonkoHenri requested review from FeodorFitsner and Copilot and removed request for Copilot February 18, 2026 06:08
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 18, 2026

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a65e756
Status:⚡️  Build in progress...

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 18, 2026

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea10651
Status: ✅  Deploy successful!
Preview URL: https://e00763b0.flet-examples.pages.dev
Branch Preview URL: https://textfield-ignore-up-down-key.flet-examples.pages.dev

View logs

# Conflicts:
#	sdk/python/packages/flet-web/src/flet_web/fastapi/flet_app.py
@FeodorFitsner FeodorFitsner merged commit 06ea731 into main Feb 19, 2026
10 of 49 checks passed
@FeodorFitsner FeodorFitsner deleted the textfield-ignore-up-down-keys branch February 19, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to keep cursor position when pressing up/down arrow keys in TextField

2 participants