Ember-power-select: Missing `class` option {{power-select}}

Created on 10 Jun 2016  路  10Comments  路  Source: cibernox/ember-power-select

I noticed in in 1.0.0-alpha.1 version, even though I passed class option to {{power-select}} component, the class name is not added to the .ember-basic-dropdown container.

I seems the option was there in 0.10.10: https://github.com/cibernox/ember-power-select/blob/v0.10.10/addon/templates/components/power-select.hbs#L7.

Is there a reason that option was removed? Or is there something else I need to add?

Thanks

Most helpful comment

FWIW, I looked in the Styles section for this before finding this issue.

All 10 comments

Yes, there is no class in .ember-basic-dropdown because there is no .ember-basic-dropdown. The component is now simpler and doesn't require any wrapper, the trigger is right there.
Check the changelog: https://github.com/cibernox/ember-power-select/blob/master/CHANGELOG.md

@cibernox Thanks for the explanation :-) I understand it makes the component simpler but it seems broke some styles in my project after upgrading to the alpha version since before we customize the "wrapper" by adding a class to it, and there are some styles around that specific class.

It seems like the removal of the class option is now causing the acceptance test helper selectChoose(cssPath, optionText) to fail. I'm not sure what my cssPath should be since class can no longer be specified on the component. I'm only seeing this will single select, not multi-select since class can still be specified on multi-select.

I had to wrap my power-select in a div with an id, and then use that id as my cssPath in the select-choose("#someId", "optionText") to get it to work.

      <div id="someId">
        {{#power-select
          ...
        {{/power-select}}
      </div>

@cibernox is the lack of ability to add a class to the top-level element here considered a wontfix? If not, would you be willing to reopen the issue?

edit: to clarify - I realize the top level component is tagless, but ultimately what gets rendered is a single ember-basic-dropdown-trigger, and then the ember-basic-dropdown-content-N for the menu. It would be somewhat limiting if we were unable to customize the styles on a per-instance basis via attached class names.

@davewasmer You can. Use triggerClass="my-class" and/or dropdownClass="my-other-class"

@cibernox - ah, my mistake. I was looking under the "Styles" section on the site. Would you be open to a PR to mention them there?

All the options are listed in http://www.ember-power-select.com/docs/api-reference

I don't really think that the styles section is the best for this since that section is only about css/sass, while customizing class names is more related with templates.

FWIW, I looked in the Styles section for this before finding this issue.

I guess that I should put at least a link from one section to another given that more people got confused.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorkas picture jorkas  路  8Comments

Argun picture Argun  路  3Comments

knownasilya picture knownasilya  路  10Comments

orf picture orf  路  10Comments

danconnell picture danconnell  路  7Comments