Mobius1 / Selectr

A lightweight, vanilla javascript select box replacement. No dependencies.
MIT License
312 stars 77 forks source link

searchPlaceholder message option don't working #142

Open enventa opened 4 years ago

enventa commented 4 years ago

I know that the searchPlaceholder message option is not documented (see issue #130) but it can be found in the code.

The thing is that it is not working for me. No matter if I define that option or not, nothing is displayed on the search box. Other messages options are, but not the searchPlaceholder one. Any idea why?

I'm using this code:

var selectr = new MolonguiSelectr(authorSelect,
{
    messages:
    {
        noOptions:      "No cars available",
        noResults:      "No cas found",
        searchPlaceholder:  "Find car by name...",
    }
});

Thanks!

brada1703 commented 4 years ago

Hey @enventa,

So, there are two types of placeholders. The first one is the normal placeholder for the input that you see before you click it. This is defined by placeholder as seen below. Then, upon clicking it, you notice that you have another search box that you type into. This is defined by searchPlaceholder as seen below.

let exampleSelect = new Selectr(exampleID, {
    placeholder: 'Click on me', 
    messages: {
        noResults: "No results",
        noOptions: "No options",
        searchPlaceholder: "Search options"
    }
})

Hope that helps!