desktop: edit previous message with Up arrow (#2841)

This commit is contained in:
Stanislav Dmitrenko
2023-08-03 12:32:01 +03:00
committed by GitHub
parent 105a6afb4b
commit 760282cdfd
6 changed files with 23 additions and 2 deletions
@@ -37,6 +37,7 @@ actual fun PlatformTextField(
showDeleteTextButton: MutableState<Boolean>,
userIsObserver: Boolean,
onMessageChange: (String) -> Unit,
onUpArrow: () -> Unit,
onDone: () -> Unit,
) {
val cs = composeState.value
@@ -83,7 +84,11 @@ actual fun PlatformTextField(
onDone()
}
true
} else false
} else if (it.key == Key.DirectionUp && it.type == KeyEventType.KeyDown && cs.message.isEmpty()) {
onUpArrow()
true
}
else false
},
cursorBrush = SolidColor(MaterialTheme.colors.secondary),
decorationBox = { innerTextField ->