linebender / linebender/druid

TextBox loses its focus on Enter press when having a formatter

Open
#1,975 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

I've created a simple formatter to limit the maximum number of characters on TextBox but my custom controller on this TextBox stopped working. My controller sends a message when Enter is pressed but now, with formatter, when I press Enter on this TextBox the item loses its focus so my controller is not seeing this Enter press.

The minimal example to reproduce this issue is provided below (see Maan2003's comment).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal reproduction in Maan2003's comment and trace how a formatter changes TextBox focus handling on Enter. Confirm that the custom controller currently misses the key press; done means the TextBox retains focus and the controller receives Enter as it does without the formatter.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.