Skip to content

Commit

Permalink
fix(Select): init flatten ds
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed May 24, 2019
1 parent 4f279d8 commit 57667a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/select/data-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class DataStore {
this.mapDataSource = {};
// current data can be select (not disabled) on menu
this.enabledDataSource = [];
this.flattenDataSource = [];
}

setOptions(options) {
Expand Down
3 changes: 2 additions & 1 deletion src/select/select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,10 @@ class Select extends Base {
} else if (value) {
let limitedCountValue = value;
let maxTagPlaceholderEl;
const totalLen = this.dataStore.flattenDataSource.length;

if (maxTagCount !== undefined && value.length > maxTagCount) {
const totalLen = this.dataStore.getFlattenDS().length;

limitedCountValue = limitedCountValue.slice(0, maxTagCount);
maxTagPlaceholderEl = (
<Tag
Expand Down

0 comments on commit 57667a4

Please sign in to comment.