-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Labels
EnhancementNew feature or requestNew feature or request
Description
Describe the problem
Hi, I’ve been experimenting with the selection menu and its default option. For example, consider this code:
import questionary as qy
choices = [
"Option 1",
"Default Option",
"Option 3",
]
style = qy.Style(
[
# Better visibility for the selected option
("highlighted", "fg:red"),
]
)
qy.select(
message="Selection with a default option:",
choices=choices,
default=choices[1],
style=style,
).ask()The menu opens with the second option selected by default, which works as intended. However, the selected option is rendered using the inverted style and does not visually update when the focus changes.
Expanding the style parameter does not seem to work either:
style = qy.Style(
[
# Better visibility for the selected option
("highlighted", "fg:red"),
("selected", "noreverse"),
]
)Describe the solution
Changing select.py like this seems to fix the issue, but I am not entirely sure why:
ic = InquirerControl(
choices,
# default,
pointer=pointer,
use_indicator=use_indicator,
use_shortcuts=use_shortcuts,
show_selected=show_selected,
show_description=show_description,
use_arrow_keys=use_arrow_keys,
initial_choice=default,
)Alternatives considered
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or requestNew feature or request


