You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would probably be an entirely new feature. But, imagine you have a system with a million users stored in a database. And you want to select one based on a simple text search. Obviously, fetching a million users and rendering them in the select, and then using the searcher function to match them, is infeasible. Instead, you want the items that appear to be selected to be dynamic, using API calls to the backend to fetch the items based on what the user has typed so far. So, to implement it, instead of a static list of items, you'll have a callback:
func(inputstring) interface{}
This would have to use goroutines/channels to invoke the search in the background, while allowing the user to continue to enter text, so that after a user types a certain number of characters, it can immediately issue the search callback, and then continue to allow the user to type and refine the search, waiting till the previous callback has returned till it invokes the callback again with the currently input text (if different from the previous callback invocation).
Since Items in Select is currently interface{}, perhaps it could be possible to add this support to the existing select, I'm not sure if that would make sense or not.
The text was updated successfully, but these errors were encountered:
This would probably be an entirely new feature. But, imagine you have a system with a million users stored in a database. And you want to select one based on a simple text search. Obviously, fetching a million users and rendering them in the select, and then using the searcher function to match them, is infeasible. Instead, you want the items that appear to be selected to be dynamic, using API calls to the backend to fetch the items based on what the user has typed so far. So, to implement it, instead of a static list of items, you'll have a callback:
This would have to use goroutines/channels to invoke the search in the background, while allowing the user to continue to enter text, so that after a user types a certain number of characters, it can immediately issue the search callback, and then continue to allow the user to type and refine the search, waiting till the previous callback has returned till it invokes the callback again with the currently input text (if different from the previous callback invocation).
Since
Items
inSelect
is currentlyinterface{}
, perhaps it could be possible to add this support to the existing select, I'm not sure if that would make sense or not.The text was updated successfully, but these errors were encountered: