prompt-toolkit / prompt-toolkit/python-prompt-toolkit

TextArea and key bindings

Open
#1,862 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a text area inside an application. This application contains key bindings like "0", "1" as kind of short cut.

As a text area is a user input i would expect it to consume the input chars first when it is active. And when the input is not consumed, to be propagated at the parent component... until the application key bindings.

But what i have noticed is that the key binding are triggered first.

I think i haven't found documentation about event propagation. But I feel like it's a problem, because it's the only lib handling widget this way.

Do you consider it as a bug? In this case i could maybe find a way to change this behaviour?

On my side, i think i will try to filter some bindings, depending on the active widget.

Contributor guide

No contributing guide indexed for this repository

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

No files, tests, or entry points are named. First reproduce the interaction with a TextArea and numeric key bindings, then inspect the event-propagation and key-binding documentation or implementation. Done would require an agreed behavior for input consumption and propagation, plus a focused test or documentation change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.