Make cursor jump to end by default

This commit is contained in:
imkunet 2024-02-19 15:22:43 -05:00 committed by imkunet
parent 5a42eb0d5f
commit 44cffcfcf7
No known key found for this signature in database
GPG Key ID: 32E0ECFB90A68C42

View File

@ -15,6 +15,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.TextFieldValue
import eu.kanade.tachiyomi.ui.manga.notes.MangaNotesScreenState import eu.kanade.tachiyomi.ui.manga.notes.MangaNotesScreenState
@Composable @Composable
@ -23,7 +25,9 @@ fun MangaNotesTextArea(
onSave: (String) -> Unit, onSave: (String) -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
var text by remember { mutableStateOf(state.notes.orEmpty()) } var text by remember {
mutableStateOf(TextFieldValue(state.notes.orEmpty(), TextRange(Int.MAX_VALUE)))
}
val focusRequester = remember { FocusRequester() } val focusRequester = remember { FocusRequester() }
Column( Column(
@ -47,7 +51,7 @@ fun MangaNotesTextArea(
DisposableEffect(Unit) { DisposableEffect(Unit) {
onDispose { onDispose {
onSave(text) onSave(text.text)
} }
} }
} }