Skip to content

Commit

Permalink
fix: crash when checking multi selection input (#3933)
Browse files Browse the repository at this point in the history
  • Loading branch information
Balcan authored Dec 18, 2024
1 parent 7dca28c commit b01db32
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ internal fun ProvideMultiSelectionInput(
legendData = fieldUiModel.legend(),
isRequired = fieldUiModel.mandatory,
onItemsSelected = {
val checkedValues = it.filter { item -> item.checked }.map { checkBoxData ->
val selectedIndex = data.indexOf(checkBoxData)
codeList[selectedIndex]
val checkedValues = it.mapNotNull { checkBoxData ->
if (checkBoxData.checked) {
val selectedIndex = data.indexOfFirst { originalData -> originalData.uid == checkBoxData.uid }
codeList[selectedIndex]
} else {
null
}
}

intentHandler(
Expand Down

0 comments on commit b01db32

Please sign in to comment.