react-native-autosuggest
react-native-autosuggest copied to clipboard
Allow suggestions to take and return objects
I've added functionality for passing objects in as terms (in the shape {term: string, searchableID?: string, ...}
) so the suggestions can be used to return objects, and also allow search-ability by a hidden ID. I've also added a prop to AutoSuggest
called formatString
to allow for items found using the searchableID
to be displayed differently to signify how it was found.
It's something I've added for my own use, but think it's a useful thing for everyone.
Whether or not you perceive this to be within the scope of the project (or complete enough to be included), thanks for looking.
I've also just committed 629c9e8, which highlights a candidate for another styling prop, which should probably be opened as a separate issue
Awesome! I choose this package for how straighforward it is. Having terms as just strings was a bit too limiting though. Thanks for this PR!
I was also thinking that returned search results should be React components for maximum flexibility. I might take a stab at that.
I think this is a good feature request. Thank you for this PR. I realize this PR is over a month old and I did not have github notifications turned on for repos (I get a lot of gh spam from all my work repos), so this might be old hat. If so, sorry, and thanks for your contribution.
I have pushed some changes (mostly formatting + eslint / prettier / dev stuff) so this PR no longer merges cleanly (eslint/precommit hook is a prerequisite if this module is something the world could contribute to).