How to keep the original order of an arg list once you start filtering?
#1349
Closed
ramiroaraujo
started this conversation in
General
Replies: 2 comments
-
|
You can do this: let numbers = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]
let result = await arg(
{
placeholder: "Search numbers",
debounceInput: 0, // If the list is "static", you can set this to 0
},
input => {
return numbers.filter(n => n.includes(input))
}
)I'll have a version that can do the fuzzy match + highlighting as part of the API soon. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks!! That did it :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm fetching some log data from a service, and prompt to select from a pretty large list. This list is correctly sorted, but once I start filtering in the UI the sorting seems to be changed to a string sorting based on the input, or at the very least it changes from the original one. Is there a way to avoid this?
If not, I would add it as a nice to have! I could try to add a PR for it myself if it sounds good
Beta Was this translation helpful? Give feedback.
All reactions