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

{{else}} block for empty results #1370

Open
esbanarango opened this issue Jun 3, 2020 · 2 comments
Open

{{else}} block for empty results #1370

esbanarango opened this issue Jun 3, 2020 · 2 comments

Comments

@esbanarango
Copy link
Contributor

We're upgrading from 3.0.6 to 4.0.2.
We have this searchable power-select component, and we were using the {{else}} block for displaying custom html code when no results. After upgrading that block isn't showing anymore.

{{#power-select
  searchEnabled=true
  search=(queue
            (action (mut searchName))
            (action (perform searchEmployeesFromLocationTask))
          )
  placeholder=" Type to search employees at other locations"
  labelPath="name"
  selected=changeset.name
  disabled=disabled
  onChange=(action updateEmployee) 
  as |employee|
}}
  {{employee.name}}  
{{else}}
  CUSTOM HTML CODE
{{/power-select}}

Apparently that was removed here. What's the suggested approach now? Or how could we get this {{else}} block back?

Thank you.

@ybaldus
Copy link

ybaldus commented Jun 22, 2020

At the moment the argument "noMatchesMessage" allows you to place simple text in there. If you need html code, you could write a custom modifier (https://github.com/ember-modifier/ember-modifier). Unfortunately a modifier can only be placed on the power select if it's rendered in place (it passes attributes to a basic dropdown which will only apply them if rendered in place). A solution to this would be wrapping the power select inside a div and placing the modifier on the div.

@cibernox
Copy link
Owner

cibernox commented Aug 7, 2020

Yeah, we had to give up that feature when updating to glimmer components. You still can do it by overriding the optionsComponent, but it's very inconvenient. I hope that named blocks will allow us to reintroduce this feature.

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

3 participants