Skip to content

Commit

Permalink
fix(editors): add blank entry on Select Editor should happen once (#591)
Browse files Browse the repository at this point in the history
- the problem was noticeable after opening/closing the select dropdown multiple times
  • Loading branch information
ghiscoding committed Sep 30, 2020
1 parent 666e6ee commit f847e43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/modules/angular-slickgrid/editors/selectEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export class SelectEditor implements Editor {
}

// user can optionally add a blank entry at the beginning of the collection
if (this.collectionOptions && this.collectionOptions.addBlankEntry) {
if (this.collectionOptions && this.collectionOptions.addBlankEntry && Array.isArray(collection) && collection.length > 0 && collection[0][this.labelName] !== '') {
collection.unshift(this.createBlankEntry());
}

Expand Down

0 comments on commit f847e43

Please sign in to comment.