huh
huh copied to clipboard
Select choose filtering
I am looking into Select, and right now by default, filtering is false on startup.
return &Select[T]{
options: []Option[T]{},
value: new(T),
validate: func(T) error { return nil },
filtering: false,
filter: filter,
theme: ThemeCharm(),
}
I'm trying to get a user experience where the select is a filter mode when Run starts.
I wonder if there is a way to do so already, but I did not find how to override the filtering parameter before rendering the prompt.
I have in mind something like this, to a stay in line with what exist already.
func (s *Select[T]) Filtering(filtering bool) *Select[T] {
s.filtering = filtering
return s
}
Happy to contribute, if this is something you would welcome.
Hey! @PJGaetan This makes sense to me! We'll just need to make sure the s.filter textinput gets focused as well, this should be done on Update if the s.filtering is true but s.filter.Focused is false.