OnClick is now null on default for SideMenuSubentry.

Implementing an empty callback would break the behavior of the VerticalExpandable.
This commit is contained in:
Abdelilah El Aissaoui 2022-06-11 23:46:56 +02:00
parent bc56ad834a
commit 27d28cfdce

View file

@ -28,7 +28,7 @@ fun SideMenuSubentry(
iconResourcePath: String,
bold: Boolean = false,
extraPadding: Dp = 0.dp,
onClick: () -> Unit = {},
onClick: (() -> Unit)? = null,
onDoubleClick: (() -> Unit)? = null,
additionalInfo: @Composable () -> Unit = {}
) {
@ -36,7 +36,12 @@ fun SideMenuSubentry(
modifier = Modifier
.height(ENTRY_HEIGHT.dp)
.fillMaxWidth()
.combinedClickable(onClick = onClick, onDoubleClick = onDoubleClick)
.run {
if(onClick != null)
combinedClickable(onClick = onClick, onDoubleClick = onDoubleClick)
else
this
}
.padding(start = extraPadding),
verticalAlignment = Alignment.CenterVertically,
) {