charmbracelet / huh

Build terminal forms and prompts 🤷🏻‍♀️
MIT License
3.72k stars 94 forks source link

MultiSelect's filterable set to "false" will have no effect. #251

Open skatkov opened 1 month ago

skatkov commented 1 month ago

Describe the bug MultiSelect's filterable set to "false" will have no effect.

To Reproduce Steps to reproduce the behavior:

  1. run a following code:
    
    package main

import ( "github.com/charmbracelet/huh" )

func main() { var types []string

form := huh.NewMultiSelect[string]().
    Filterable(false).
    Options(
        huh.NewOption("Module", "Module").Selected(true),
        huh.NewOption("Constant", "Constant").Selected(true),
        huh.NewOption("Method", "Method").Selected(true),
        huh.NewOption("Attribute", "Attribute"),
        huh.NewOption("Class", "Class").Selected(true),
    ).
    Title("Types").
    Value(&types)

huh.NewForm(huh.NewGroup(form)).Run()

}


2. Click on "/"
3. Provide a "constant" value

**Expected behavior**
Filtering should not be possible on a MultiSelect field because `Filterable(false)` method was used.

**Desktop (please complete the following information):**
 - OS: Manjaro/Linux
 - Version github.com/charmbracelet/huh v0.4.2, go 1.22