Skip to content

Commit

Permalink
Fixed crash when using rebase interactive due to focus stack overflow
Browse files Browse the repository at this point in the history
Fixes #258
  • Loading branch information
JetpackDuba committed Jan 27, 2025
1 parent 018ce7b commit 50275c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.focus.onFocusEvent
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
Expand Down Expand Up @@ -194,12 +195,6 @@ fun RebaseCommit(
modifier = Modifier
.height(IntrinsicSize.Min)
.fillMaxWidth()
.onFocusEvent {
if (it.hasFocus && !isSelected) {
onFocusLine()
focusRequester.requestFocus()
}
}
.clickable {
onFocusLine()
}
Expand All @@ -219,7 +214,12 @@ fun RebaseCommit(
.padding(start = 8.dp)
.weight(1f)
.heightIn(min = 40.dp)
.focusRequester(focusRequester),
.focusRequester(focusRequester)
.onFocusChanged {
if (it.hasFocus && !isSelected) {
onFocusLine()
}
},
enabled = action == RebaseAction.REWORD,
value = newMessage,
onValueChange = {
Expand Down

0 comments on commit 50275c2

Please sign in to comment.