List: Expose setting of FilterValue and triggering filtering programmatically
Hey guys,
when using list to show and filter a list of items it would be handy to be able to not only set items programmatically, but also set the FilterValue and triggering filtering programmatically.
Currently we have:
// FilterValue returns the current value of the filter.
func (m Model) FilterValue() string {
return m.FilterInput.Value()
}
so the FilterValue is directly tied to the FilterInput . I could theoretically hand everything down to the FilterInput, but that would be very tedious, when I have an external separate TextInput which might set the filter.
Especially, when the filterInput sets this:
filterInput.Prompt = "Filter: " - so there is no way to customize this.
So my wishlist would be:
- [ ] Add a
SetFilterValue-func - [ ] Add a
SetLiveFilteringEnabled-func which determines if the list is automatically filtered viaFilterValue - [ ] Add a
Filter-func that actually triggers filtering viaFilterValue
Thanks for the awesome work!
(Related: #85)
Looks like https://github.com/charmbracelet/bubbles/issues/344 is also related.