Add placeholder to EasySearch


#1

How can i add placeholder to EasySearch?

{{> EasySearch.Input index=cvsIndex }}

I have read the docs, but i can’t figure out where to add the snippet on that page attributes: Object containing input attributes (e.g. { placeholder: "Search..." })


#2

You could set the placeholder in an object returned by a helper. So something like:

Template.someTemplate.helpers({
  searchAttributes() {
    return {
      placeholder: 'Some placeholder ...',
    };
  },
});

then:

{{> EasySearch.Input index=cvsIndex attributes=searchAttributes}}

#3

That works. Thank you @hwillson !