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

Placeholder component for power select multiple #817

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lazybensch
Copy link

This PR adds support for placeholderComponent: 'custom-placeholder to power-select-multiple.

I also added a regression test.

@lazybensch lazybensch force-pushed the placeholder-component-for-power-select-multiple branch from 123810e to 6e5129f Compare February 15, 2017 13:01
@@ -16,8 +16,8 @@
{{/if}}
</li>
{{else}}
{{#if (and placeholder (not searchEnabled))}}
<span class="ember-power-select-placeholder">{{placeholder}}</span>
{{#if (not-eq placeholder maybePlaceholder)}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changing the logic and concerns me.
Originally the placeholder only shows if the search was not enabled but if I'm reading this right in here it's going to show even if there is a search input. Am I wrong?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no you are right, i just realized this myself and am correcting it :) thx for the review

Copy link
Owner

@cibernox cibernox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last two comments. Then I'll merge this.

Could you add a [ENHANCEMENT] entry in the Changelog.md

@@ -17,7 +17,7 @@
</li>
{{else}}
{{#if (and placeholder (not searchEnabled))}}
<span class="ember-power-select-placeholder">{{placeholder}}</span>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last comment. The way the placeholder component works in the single component is that you render it, and it already check if its placeholder property is there to decide wether it renders anything or not.

In think that you simplify this to

{{#if (not searchEnabled)}}
  {{component placeholderComponent placeholder=placeholder}}
{{/if}}

@@ -70,7 +70,10 @@ export default Component.extend({
}),

maybePlaceholder: computed('placeholder', 'select.selected.length', function() {
if (isIE) {
let component = this.get('placeholderComponent');
let hasCustomPlaceholder = component !== 'power-select/placeholder';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are not going to render this placeholder if the search is disabled, I think that you don't need this code.

CHANGELOG.md Outdated
@@ -6,6 +6,8 @@
there before. EPS doens't rely on those attributes and it's unlikely that this will
break for anyone, but just in case I'll bump a minor version number and keep it in
beta for some days.
- [ENHANCEMENT] Providing a custom `placeholderComponent` is available for
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must put this below # Master.

@lazybensch lazybensch force-pushed the placeholder-component-for-power-select-multiple branch from 3b9a183 to 13ad5b5 Compare February 15, 2017 15:41
@cibernox
Copy link
Owner

@lazybensch can you rebase this? The code looks good now, and the tests should be green if you rebase.

@Wozniaxos
Copy link

@cibernox Hey! Do you know what is the status of this feature? Can it be rebased and merged? Or this was provided at some other later PR's?

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

Successfully merging this pull request may close these issues.

None yet

3 participants