The component behind Drafter.Prompt.select/3, multiselect/3 and search/3: a
list to pick one or several entries from.
Options
:label- the question:choices- the entries, each anythingDrafter.Prompt.Choice.new/1accepts:source-(query -> choices), called with the typed text on every change, in place of:choices:multiple-truepicks several entries and returns their values as a list:filter-truenarrows the list to the entries containing the typed text, ignoring case. Always on with:source:default- the value highlighted first, or with:multiplethe list of values picked first:minand:max- with:multiple, the fewest and most entries that may be picked. Defaults0and no limit:limit- the most entries shown at once. Defaultconfig :drafter, prompt_limit: 7
Keys
Up, Down, Ctrl+P, Ctrl+N, Page Up, Page Down, Home and End move the highlight, which
skips disabled entries and wraps at either end. Enter picks. Esc clears the typed
text if there is any and otherwise stops the prompt with :cancelled.
Without :filter, k and j also move. With :multiple, Tab picks or unpicks
the highlighted entry and Ctrl+A all of them; without :filter, Space and a do
the same.