question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass list of initially toggled options for multi-select menus

See original GitHub issue

Hey!

I’m looking for something like this:

options = ["apple", "banana", "orange"]
menu = TerminalMenu(options, multi_select=True, selected_options=set([0]))
menu.show()

… which would show:

> [*] apple
  [ ] banana
  [ ] orange

Is it possible to provide a multi-select menu with a list of options that are already set to True?

Thanks for maintaining this amazing project! Any feedback is appreciated!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
IngoMeyer441commented, Jul 7, 2021

You can pass the initial cursor index with the cursor_index constructor parameter.

1reaction
IngoMeyer441commented, Jul 7, 2021

Hey @kelvindecosta, definitely a useful feature request and should not be so much work to implement. I will look into this when I have some free time!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get all selected values of a multiple select box?
In the case of <select multiple="multiple"> elements, the .val() method returns an array containing each selected option;.
Read more >
Drop-Down Menu or list box for multiple selection - Plus2net
HTML form dropdown list with name size and multiple options with code in webpage.
Read more >
How to Create a Custom Multi-Select (OR Single) Menu
In today's video we'll be creating a custom multi - select (or single-select) menu using HTML, CSS & JavaScript. This is very easy...
Read more >
Bootstrap Multiselect Examples - CodeHim
When using the plugin for single selections (without the multiple attribute present), the first option will automatically be selected if no other option...
Read more >
Cannot display multi static select menu with initial options from ...
I'm trying to load a multi static select menu with some pre-loaded initial options. I'm able to successful display the menu with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found