Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix #715 input_dialog completion doesn't appear to have any effect #1970

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/prompt_toolkit/shortcuts/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
from prompt_toolkit.key_binding.bindings.focus import focus_next, focus_previous
from prompt_toolkit.key_binding.defaults import load_key_bindings
from prompt_toolkit.key_binding.key_bindings import KeyBindings, merge_key_bindings
from prompt_toolkit.layout import Layout
from prompt_toolkit.layout import Float, FloatContainer, Layout
from prompt_toolkit.layout.containers import AnyContainer, HSplit
from prompt_toolkit.layout.dimension import Dimension as D
from prompt_toolkit.layout.menus import CompletionsMenu
from prompt_toolkit.styles import BaseStyle
from prompt_toolkit.validation import Validator
from prompt_toolkit.widgets import (
Expand Down Expand Up @@ -143,10 +144,28 @@ def ok_handler() -> None:
body=HSplit(
[
Label(text=text, dont_extend_height=True),
textfield,
ValidationToolbar(),
FloatContainer(
HSplit(
[
textfield
],
height=D(min=8, preferred=10, max=16)
),
[
Float(
xcursor=True,
ycursor=True,
transparent=True,
content=CompletionsMenu(
max_height=16,
scroll_offset=1
)
)
]
),
ValidationToolbar()
],
padding=D(preferred=1, max=1),
padding=D(preferred=1, max=1)
),
buttons=[ok_button, cancel_button],
with_background=True,
Expand Down
Loading