Skip to content

Conversation

ainulbedjo
Copy link

@ainulbedjo ainulbedjo commented May 19, 2024

Opened a PR from this issue : #12.

So basically, you can't listen to backspace on empty textfield (source) even with this code below it doesnt work (on my machine tho).

// Listens for backspace key event when textfield is empty. Moves to previous node if possible.
    return RawKeyboardListener(
        focusNode: FocusNode(),
        onKey: (value) {
          if (value.logicalKey.keyLabel == 'Backspace') {
            changeFocusToPreviousNodeWhenTapBackspace();
          }
        },
        child: generateTextFields(context));

I make this workaround by making the textField limit to 2 and set an empty character \u200b to it. So when user pressed the backspace, it listen to it, and direct the focus to previous textfield.

add extra empty space to handle delete on empty fields
@ainulbedjo
Copy link
Author

Hi @david-legend,
could you review this PR? thanks

@david-legend
Copy link
Owner

checking soon

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.

3 participants