Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List: Expose setting of FilterValue and triggering filtering programmatically #129

Open
3 tasks
toadle opened this issue Mar 28, 2022 · 2 comments
Open
3 tasks
Labels
enhancement New feature or request

Comments

@toadle
Copy link
Contributor

toadle commented Mar 28, 2022

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 via FilterValue
  • Add a Filter-func that actually triggers filtering via FilterValue

Thanks for the awesome work!

@meowgorithm
Copy link
Member

(Related: #85)

@decentral1se
Copy link

Looks like #344 is also related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants