This repository was archived by the owner on Dec 28, 2024. It is now read-only.
Avoid to create a new array each selection#153
Open
jorgecasar wants to merge 1 commit intoPolymerElements:masterfrom
Open
Avoid to create a new array each selection#153jorgecasar wants to merge 1 commit intoPolymerElements:masterfrom
jorgecasar wants to merge 1 commit intoPolymerElements:masterfrom
Conversation
jorgecasar
commented
Apr 26, 2017
| selector.multi = true; | ||
| selector.selectedValues = ['non-existing-value']; | ||
| assert.deepEqual(selector.selectedItems, [undefined]); | ||
| assert.deepEqual(selector.selectedItems, []); |
Author
There was a problem hiding this comment.
If you select a non existing value the selectedItems must be an empty array
f90849f to
d29ebb7
Compare
abdonrd
suggested changes
Apr 29, 2017
iron-multi-selectable.html
Outdated
| if (this.multi) { | ||
| this._setSelectedItems(s); | ||
| if (isSelected) { | ||
| this.splice('selectedItems', this.selectedItems.length, 0, item); |
Member
There was a problem hiding this comment.
Why not simply this.push('selectedItems', item);?
iron-multi-selectable.html
Outdated
| } else { | ||
| this._setSelectedItems([s]); | ||
| this._setSelectedItem(s); | ||
| this._setSelectedItems(isSelected?[item]:[]); |
Member
There was a problem hiding this comment.
Spaces: this._setSelectedItems(isSelected ? [item] : []);
iron-multi-selectable.html
Outdated
| this._setSelectedItems([s]); | ||
| this._setSelectedItem(s); | ||
| this._setSelectedItems(isSelected?[item]:[]); | ||
| this._setSelectedItem(isSelected?item:undefined); |
Member
There was a problem hiding this comment.
Spaces: this._setSelectedItem(isSelected ? item : undefined);
iron-selectable.html
Outdated
| _selectionChange: function() { | ||
| this._setSelectedItem(this._selection.get()); | ||
| _selectionChange: function(isSelected, item) { | ||
| this._setSelectedItem(isSelected?item:undefined); |
Member
There was a problem hiding this comment.
Spaces: this._setSelectedItem(isSelected ? item : undefined);
d29ebb7 to
1750695
Compare
7aee6b4 to
1750695
Compare
1750695 to
d4d03e9
Compare
Signed-off-by: Jorge del Casar <jorge.casar@gmail.com>
d4d03e9 to
f10c99c
Compare
Member
|
Friendly ping to @bicknellr (code owner). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solve #152
Signed-off-by: Jorge del Casar jorge.casar@gmail.com