Skip to content

Commit 29db209

Browse files
committed
Fix crash when focusing remove button in device list screen
1 parent 364772f commit 29db209

File tree

1 file changed

+9
-1
lines changed
  • android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell

1 file changed

+9
-1
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/BaseCell.kt

+9-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ internal fun BaseCell(
7373
horizontalArrangement = Arrangement.Start,
7474
modifier =
7575
modifier
76-
.clickable(isRowEnabled, onClick = onCellClicked)
76+
// This is to avoid a crash when a child view is focused and clickable is set to
77+
// false on the parent view
78+
.then(
79+
if (isRowEnabled) {
80+
Modifier.clickable(onClick = onCellClicked)
81+
} else {
82+
Modifier
83+
}
84+
)
7785
.wrapContentHeight()
7886
.defaultMinSize(minHeight = minHeight)
7987
.fillMaxWidth()

0 commit comments

Comments
 (0)