Skip to content

Commit

Permalink
Add default value option for input dialog (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
motty-mio2 authored Apr 20, 2022
1 parent 50a43e9 commit 8ce4065
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/prompt_toolkit/shortcuts/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def input_dialog(
validator: Optional[Validator] = None,
password: FilterOrBool = False,
style: Optional[BaseStyle] = None,
default: str = "",
) -> Application[str]:
"""
Display a text input box.
Expand All @@ -126,6 +127,7 @@ def ok_handler() -> None:
cancel_button = Button(text=cancel_text, handler=_return_none)

textfield = TextArea(
text=default,
multiline=False,
password=password,
completer=completer,
Expand Down

0 comments on commit 8ce4065

Please sign in to comment.