ListItem: Don't apply clickable modifier if onClick is null. (#1146)
If it is applied but disabled (like before this PR) it will hijack all touch input from the view and no other component in it can respond to clicks.
This commit is contained in:
parent
b326ca28cc
commit
0abda97d6f
1 changed files with 1 additions and 1 deletions
|
|
@ -119,7 +119,7 @@ fun ListItem(
|
|||
|
||||
androidx.compose.material3.ListItem(
|
||||
headlineContent = decoratedHeadlineContent,
|
||||
modifier = Modifier.clickable(enabled = enabled && onClick != null, onClick = onClick ?: {}).then(modifier),
|
||||
modifier = if (onClick != null) Modifier.clickable(enabled = enabled, onClick = onClick).then(modifier) else modifier,
|
||||
overlineContent = null,
|
||||
supportingContent = decoratedSupportingContent,
|
||||
leadingContent = decoratedLeadingContent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue