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

[DOCUMENTATION] validate_while_typing

Open
#955 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 there!

I'm using this library and it's great; I ran into a problem and ended digging the code. The problem was that I was expecting validation after pressing "enter" but it was validating ¿each keystroke? Setting validate_while_typing = False fixed the problem.

Nonetheless, the documentation says that the validation is run after pressing enter (which means that "validate_while_typing" is default=False), but looking at the code, I believe that the default is the opposite (`shortcuts/prompt.py')

validate_while_typing=True # in version 2.0.9 (the one I'm using)
validate_while_typing: FilterOrBool = True, # in current master version

Thanks for sharing this library, it's really amazing.

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

Read shortcuts/prompt.py to confirm the current default for validate_while_typing, then locate the documentation that describes validation timing. Update the documentation so it matches the confirmed default behavior and verify that the description distinguishes validation on each keystroke from validation after pressing Enter.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.