diff --git a/docs/changelog.md b/docs/changelog.md index 9fbef6e5..3c097fcd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 diff --git a/libraries/ui-library/src/components/six-select/six-select.tsx b/libraries/ui-library/src/components/six-select/six-select.tsx index e8d4fe44..a5725667 100644 --- a/libraries/ui-library/src/components/six-select/six-select.tsx +++ b/libraries/ui-library/src/components/six-select/six-select.tsx @@ -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);