frontend: initial multi-line support

This commit is contained in:
hippoz 2022-05-07 16:50:04 +03:00
parent d1654546fa
commit 97d155667d
No known key found for this signature in database
GPG key ID: 7C52899193467641
2 changed files with 11 additions and 6 deletions

View file

@ -28,6 +28,7 @@
.message-content {
color: var(--foreground-color-2);
white-space: pre-wrap;
}
.pending {

View file

@ -44,10 +44,14 @@
};
const onKeydown = async (e) => {
if (e.code !== "Enter")
return;
await sendMessage();
if (e.code === "Enter") {
if (e.shiftKey) {
return;
} else {
e.preventDefault();
await sendMessage();
}
}
};
</script>
@ -82,13 +86,13 @@
</style>
<div class="message-input-container">
<input
<textarea
placeholder={`Send something interesting to #${channel.name}`}
type="text"
class="message-input"
on:keydown={ onKeydown }
bind:value={ messageInput }
>
/>
{#if $smallViewport}
<button class="icon-button send-button" on:click="{ sendMessage }">
<SendIcon />