Prompt-like input box in Console #1324
-
I'm currently trying to create a input box with a title inside a Panel, and have this all render to an alternate screen with a Console. Ideally, this would have an input box (something like the Prompt behaviour) that the user can type in, rendered inside a Panel.
What I have right now looks something like: main_panel = RenderGroup(Text(prompts[index].title), Prompt.ask("Your answer:", default=""))
main_panel = Align.center(Panel(main_panel, expand=False, height=10), vertical="middle") However, this shows a blocking "Your answer:" prompt over everything, and the main panel doesn't update until after the user's given input. Is it possible to create something like this with Rich? If not, are there any suggestions for an external library? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I’m afraid not. Have a look at prompt_toolkit. |
Beta Was this translation helpful? Give feedback.
I’m afraid not. Have a look at prompt_toolkit.