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

Make display value count a variable #69 #94

Merged
merged 9 commits into from
Jan 4, 2019

Conversation

arongraham-ge
Copy link
Contributor

@arongraham-ge arongraham-ge commented Jan 4, 2019

Added a new property to make the number of selected values used in the trigger label variable.

The new property is display-value-count and its default value is 1, which is the current default behaviour.

  • When display-value-count is greater then 1 that number of values displayed in the px-dropdown trigger button.
  • The label is as a comma separated string.
  • This only works if the multi property of px-dropdown is also set.
  • Item selections greater then display-value-count will display as "N Selected", like the current behaviour

New property allows the button label to look like this:
image

bower.json Outdated Show resolved Hide resolved
test/px-dropdown-test-fixture.html Show resolved Hide resolved
test/px-dropdown-custom-tests.js Outdated Show resolved Hide resolved
@@ -618,10 +621,12 @@
* the label displayed inside the dropdown.
*/
_handleDeselection: function(evt) {
if(this.multi && this.$.selector.selectedItems.length === 1 && !this.hideSelected) {
this.displayValueSelected = this.$.selector.selectedItems[0].innerText.trim();
if(this.multi && this.$.selector.selectedItems.length > 0 && this.$.selector.selectedItems.length <= this.displayValueCount && !this.hideSelected) {

Choose a reason for hiding this comment

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

does px have a line length standard? this line & line 590 could possibly be broken up into something shorter.

@arongraham-ge arongraham-ge merged commit cc42fe7 into master Jan 4, 2019
@arongraham-ge arongraham-ge deleted the make-display-value-count-a-variable-#69 branch January 4, 2019 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants