Skip to content

Search placeholder is ignored in select-multiple #77

@omairvaiyani

Description

@omairvaiyani

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);
}		

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions