meteor-autocomplete icon indicating copy to clipboard operation
meteor-autocomplete copied to clipboard

Template to control selected value

Open dcworldwide opened this issue 10 years ago • 9 comments

I think we need more control over the selected value. A function to transform the value based on the selected document would solve this problem. I.e match is made on Document.X but selection result is Document.Y or something more complex (like Document.X + '-' + Document.Y)

I hit this problem when writing an emoji look up using a colon : as a token. The result was ::smile: when i wanted :smile

dcworldwide avatar Jun 15 '15 01:06 dcworldwide

+1 but I guess this could also be done with just an option to exclude the token or?

allanlundhansen avatar Jul 23 '15 07:07 allanlundhansen

+1 I love to have this feature as well

leizard avatar Aug 14 '15 05:08 leizard

+1

minfawang avatar Aug 17 '15 18:08 minfawang

I don't understand exactly what the request is. Can you provide an example?

mizzao avatar Aug 17 '15 20:08 mizzao

For example, an emoji's code has a name wrapped with colons like :grin:. So when user is typing in text in an input section, the expected behavior is that when user types in :, the autocompletion should be triggered. However, if we set the token to be : and try to match the emoji's code, then after the user selects the item from the suggestion list, the input content will be something like ::grin:.

minfawang avatar Aug 17 '15 20:08 minfawang

Actually there is another issue with this example. Right now if the field being matched contains character same as the token, then a new completion is triggered. So if the user types in :grin: trying to match the emoji code :grin:, this package will treat the input as :grin and :. I think sometimes this is desired, but it would be nice to have an option to allow match text "overwriting" the token.

minfawang avatar Aug 17 '15 20:08 minfawang

Another example is tagging other users. An user may wants to tag a person by searching for the real name. Let's say we match the field lastname, but when the user selects one item from the suggestion list, we may want to show username instead.

If there is a user with lastname Brown and username br012, and another person might want to type in @Brown and sees the input content as @br012.

minfawang avatar Aug 17 '15 20:08 minfawang

Hi all - I am currently working on adding autoform support and would allow the control of selected values as part of that. Any input would be appreciated.

mizzao avatar Aug 25 '15 17:08 mizzao

+1

proft avatar Dec 19 '15 16:12 proft