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

Custom Search (Records) + Search Enabled + Multiple - SearchField: Not supported kinda? #1365

Open
krainboltgreene opened this issue May 6, 2020 · 1 comment

Comments

@krainboltgreene
Copy link

So I have a component that does exactly as described:

  • I have a search field that the user can type in
  • That search then hits a http api with a filter
  • The list of results is shown below
  • The user can select from the list, many of them in fact
  • The user can click the X or Backspace in the search input

And everything works as expected! ...With one exception:

Uncaught Error: Assertion Failed: `<PowerSelectMultiple>` requires a `@searchField` when the options are not strings to remove options using backspace

Which is weird, because it actually does what I expect. What's up? Am I missing something?

Here's the template:

<PowerSelectMultiple
  @selected={{@selected}}
  @placeholder={{@placeholder}}
  @searchEnabled={{true}}
  @searchField={{false}}
  @search={{perform this.search}}
  @disabled={{@disabled}}
  @allowClear={{@allowClear}}
  @onChange={{fn (mut @selected)}}
  as |record searchTerm| >
  {{#if hasBlock}}
    {{yield record searchTerm}}
  {{else}}
    {{record.displayName}}
  {{/if}}
</PowerSelectMultiple>
@krainboltgreene krainboltgreene changed the title Custom Search (Records) + Search Enabled + Multiple - SearchField: Not supported kind? Custom Search (Records) + Search Enabled + Multiple - SearchField: Not supported kinda? May 6, 2020
@Allerby
Copy link

Allerby commented May 5, 2021

We're running into the same error using the addon in a similar fashion. Hitting backspace with items in the select list provides the same exception:

Uncaught Error: Assertion Failed: `<PowerSelectMultiple>` requires a `@searchField` when the options are not strings to remove options using backspace
<PowerSelectMultiple
  @renderInPlace={{true}}
  @searchEnabled={{true}}
  @search={{perform this.crewSearch}}
  @placeholder="Start typing name or username"
  @selected={{@selected}}
  @onChange={{perform @onChange}}
  as |crew|>
  {{crew.interviewer_name_and_username}}
</PowerSelectMultiple>

@krainboltgreene - did you manage to find a solution/workaround for this one?

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