diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt index ac1c6f9..fe7182f 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt @@ -520,13 +520,17 @@ private fun EventEditContent( .padding(start = 24.dp, end = 24.dp, top = 8.dp, bottom = 40.dp), ) { // Title: borderless headline, mirroring the detail screen's title + - // accent bar instead of a boxed Material text field. + // accent bar instead of a boxed Material text field. Multi-line so long + // titles wrap instead of scrolling off one line (#33); newlines are + // stripped in setTitle, so this stays a single logical line — the Enter + // key just has no effect. InlineField( value = form.title, onValueChange = viewModel::setTitle, placeholder = stringResource(R.string.event_edit_title_hint), textStyle = MaterialTheme.typography.headlineMedium .copy(fontWeight = FontWeight.SemiBold), + singleLine = false, enabled = !locked, modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt index fe1ec73..e2da425 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt @@ -336,7 +336,11 @@ class EventEditViewModel @Inject constructor( _revealed.value = _revealed.value + field } - fun setTitle(value: String) = update { it.copy(title = value) } + // The title field wraps (multi-line) so long titles stay visible (#33), but + // a title is one logical line: drop any newline the IME's Enter key or a + // paste would introduce, so it never reaches the provider's TITLE column. + fun setTitle(value: String) = + update { it.copy(title = value.replace("\n", "").replace("\r", "")) } fun setLocation(value: String) = update { it.copy(location = value) } fun setDescription(value: String) = update { it.copy(description = value) } fun setAllDay(value: Boolean) {