Skip to content

Commit

Permalink
Merge pull request #297 from six-group/fix/283-six-select-checkmark-bug
Browse files Browse the repository at this point in the history
Fix #283 six-select checkmark bug
  • Loading branch information
aggieN authored Sep 19, 2024
2 parents 7a9e772 + 2ee4e4a commit 27228f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Fixed

- `six-select`: fix displaying label instead of value in autocomplete mode
- `six-select`: fix multiple checkmark bug for single select mode

### Changed

Expand Down
13 changes: 11 additions & 2 deletions libraries/ui-library/src/components/six-select/six-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,20 @@ export class SixSelect {

selectionContainerItems.forEach((item) => {
item.checkType = this.multiple ? 'checkbox' : 'check';
item.checked = value.includes(item.value);
if (Array.isArray(value)) {
item.checked = value.some((val) => val === item.value);
} else {
item.checked = value === item.value;
}
});

mainItems.forEach((item) => {
item.checkType = this.multiple ? 'checkbox' : 'check';
item.checked = value.includes(item.value);
if (Array.isArray(value)) {
item.checked = value.some((val) => val === item.value);
} else {
item.checked = value === item.value;
}
});

const checkedItems = getCheckedItems(convertToValidArrayValue(this.value), mainItems);
Expand Down

0 comments on commit 27228f4

Please sign in to comment.