frontend: initial multi-line support
This commit is contained in:
parent
d1654546fa
commit
97d155667d
2 changed files with 11 additions and 6 deletions
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
color: var(--foreground-color-2);
|
color: var(--foreground-color-2);
|
||||||
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pending {
|
.pending {
|
||||||
|
|
|
@ -44,10 +44,14 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const onKeydown = async (e) => {
|
const onKeydown = async (e) => {
|
||||||
if (e.code !== "Enter")
|
if (e.code === "Enter") {
|
||||||
|
if (e.shiftKey) {
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
e.preventDefault();
|
||||||
await sendMessage();
|
await sendMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -82,13 +86,13 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="message-input-container">
|
<div class="message-input-container">
|
||||||
<input
|
<textarea
|
||||||
placeholder={`Send something interesting to #${channel.name}`}
|
placeholder={`Send something interesting to #${channel.name}`}
|
||||||
type="text"
|
type="text"
|
||||||
class="message-input"
|
class="message-input"
|
||||||
on:keydown={ onKeydown }
|
on:keydown={ onKeydown }
|
||||||
bind:value={ messageInput }
|
bind:value={ messageInput }
|
||||||
>
|
/>
|
||||||
{#if $smallViewport}
|
{#if $smallViewport}
|
||||||
<button class="icon-button send-button" on:click="{ sendMessage }">
|
<button class="icon-button send-button" on:click="{ sendMessage }">
|
||||||
<SendIcon />
|
<SendIcon />
|
||||||
|
|
Loading…
Reference in a new issue