Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sa-si-dev committed Nov 20, 2022
1 parent b61b63f commit a380439
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "virtual-select-plugin",
"version": "1.0.34",
"version": "1.0.35",
"description": "A javascript plugin for dropdown with virtual scroll",
"scripts": {
"start": "webpack --mode development --watch",
Expand Down
11 changes: 9 additions & 2 deletions src/virtual-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,9 @@ export class VirtualSelect {
}
};

options.forEach(prepareOption);
if (Array.isArray(options)) {
options.forEach(prepareOption);
}

const optionsLength = preparedOptions.length;
const { $ele } = this;
Expand Down Expand Up @@ -2506,7 +2508,12 @@ export class VirtualSelect {
return;
}

const groupIndex = DomUtils.getData($option, 'groupIndex', 'number');
let groupIndex = DomUtils.getData($option, 'groupIndex');

if (groupIndex !== undefined) {
groupIndex = parseInt(groupIndex);
}

const $group = this.$options.querySelector(`.vscomp-option[data-index="${groupIndex}"]`);
const isAllSelected = typeof isSelected === 'boolean' ? isSelected : this.isAllGroupOptionsSelected(groupIndex);

Expand Down

0 comments on commit a380439

Please sign in to comment.