Ability to change Select filterfunc #661
Replies: 5 comments
-
|
Hi there! I'm converting this to a discussion so we can chat about it. If we think it makes sense, we'll open an issue to track the feature. |
Beta Was this translation helpful? Give feedback.
-
|
So I think this makes sense because the ability to filter results is an essential feature of the Select prompt and allowing users to modify how the filtering works is important because different data sets can benefit from different filters. Futhermore, users can create complex filter functions for advanced needs. |
Beta Was this translation helpful? Give feedback.
-
|
There's a lot of scenarios where having a custom filter function makes sense. I'm using E.g. I've created a pull request that implements the change: PR |
Beta Was this translation helpful? Give feedback.
-
|
I was just looking for something like this - hope it gets implemented! To elaborate (sorry, original comment felt like too much of a "+1" comment) - the thing I'm trying to do is essentially filter the results based on an API query. So, as the user types, I want hit the API (after some "debounce" period so that the API isn't hit too often) and then show a completely new set of options based on what the user has entered. Right now, it seems like this isn't possible. |
Beta Was this translation helpful? Give feedback.
-
|
I have a use-case for this where I have 27k+ options that are extremely slow to filter with the current Contains implementation. In my case, the user always knows the first few letters, so HasPrefix would be a lot less resource intensive. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Thanks for your great work.
In field_select.go would it be possible to allow users to set the filtering filterFunc? For long lists
strings.Containscan return many values.My use case is filtering programming languages:
In this example it would be more useful to filter by strings.HasPrefix.
Thanks for your consideration.
Beta Was this translation helpful? Give feedback.
All reactions