[fenix] For https://github.com/mozilla-mobile/fenix/issues/24897 - Move clickable handling to the parent in ExpandableListHeader

ExpandableListHeader provides a consistent UX for similar usecases.

Needed to update it to allow clicks to be handled by a parent and it not
stealing the click or shown an improper Indication.
pull/600/head
Mugurell 3 years ago committed by mergify[bot]
parent 6ceba360c9
commit 3952fc9022

@ -46,16 +46,21 @@ fun ExpandableListHeader(
expanded: Boolean? = null,
expandActionContentDescription: String? = null,
collapseActionContentDescription: String? = null,
onClick: () -> Unit = {},
onClick: (() -> Unit)? = null,
actions: @Composable () -> Unit = {},
) {
Row(
modifier = Modifier.fillMaxWidth(),
modifier = when (onClick != null) {
true -> Modifier.clickable { onClick() }
false -> Modifier
}.then(
Modifier.fillMaxWidth()
),
verticalAlignment = Alignment.CenterVertically,
) {
Row(
modifier = Modifier
.weight(1f)
.clickable(onClick = onClick)
.padding(horizontal = 16.dp, vertical = 8.dp),
verticalAlignment = Alignment.CenterVertically,
) {

Loading…
Cancel
Save