Meteor-Community-Packages / meteor-autocomplete

Client/server autocompletion designed for Meteor's collections and reactivity.
https://atmospherejs.com/mizzao/autocomplete
MIT License
350 stars 109 forks source link

Reactive values not supported for things other than `settings` #106

Closed Ethaan closed 3 months ago

Ethaan commented 8 years ago

Is something im missing?

{{> inputAutocomplete settings = settingsMentionsSearchInput id="searchMentions" class="pull-right" placeholder="Search" value="@{{this}}"}}

this return @{{this}} as plain text on the autocomplete.

mizzao commented 8 years ago

Have you just tried ... value=this}} ?

Ethaan commented 8 years ago

yes :s, still the same

mizzao commented 8 years ago

Maybe it doesn't support reactive values then; I'm not sure. What happens with value="blah"?

Ethaan commented 8 years ago
value="e"

works great, so yeah i think reactive values are not supported

Thanks for the response =D

Nolapete commented 8 years ago

I defined my reactivevars like this:

Template.Calculator.onCreated(function CalculatorOnCreated() {
    // counter starts at 0
    this.parent1 = new ReactiveVar({"name": ""});
    this.parent2 = new ReactiveVar({"name": ""});
    this.results = new ReactiveVar("collapse");
});

then assigned them in events like this:

"autocompleteselect input#parent1": function(e, t, doc) {
        Template.instance().parent1.set(doc);
    },
"autocompleteselect input#parent2": function(e, t, doc) {
        Template.instance().parent2.set(doc);
    },