react-native-autosuggest icon indicating copy to clipboard operation
react-native-autosuggest copied to clipboard

Allow suggestions to take and return objects

Open davidsharp opened this issue 7 years ago • 4 comments

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.

davidsharp avatar Oct 18 '17 10:10 davidsharp

I've also just committed 629c9e8, which highlights a candidate for another styling prop, which should probably be opened as a separate issue

davidsharp avatar Oct 18 '17 15:10 davidsharp

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!

remon-nashid avatar Oct 29 '17 10:10 remon-nashid

I was also thinking that returned search results should be React components for maximum flexibility. I might take a stab at that.

remon-nashid avatar Oct 29 '17 10:10 remon-nashid

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).

silesky avatar Dec 24 '17 06:12 silesky