Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search placeholder is ignored in select-multiple #77

Open
omairvaiyani opened this issue Jul 17, 2018 · 1 comment
Open

Search placeholder is ignored in select-multiple #77

omairvaiyani opened this issue Jul 17, 2018 · 1 comment

Comments

@omairvaiyani
Copy link

omairvaiyani commented Jul 17, 2018

I've tried setting placeholder and searchPlaceholder on {{power-select-multiple-with-create}} but no luck, it just defaults to "Type to search.".

{{#power-select-multiple-with-create
  selected=selected
  searchPlaceholder="Type to add an 'option'."
  renderInPlace=true
  onchange=(action "onChangeItems")
  oncreate=(action "onCreateItem")
as |option|}}
  {{option}}
{{/power-select-multiple-with-create}}

For now, i'm using the onopen action to manually set the text within ember-power-select-option--search-message in case anyone else is having the same issue:

workAroundForSelectOptionPlaceholder() {
    run.later(this, () => {
        try {
            const placeholderEl = document
                .getElementById(get(this, "elementId"))
                .getElementsByClassName("ember-power-select-option--search-message")[0];

            if (placeholderEl) {
                placeholderEl.innerHTML = "Type to add an 'option'.";
            }
        } catch (e) {
            console.warn("workaround failed", e);
        }
    }, 25);
}		
@esbanarango
Copy link

Facing this same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants