aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-01 21:38:26 -0800
committerAdam Soltys <[email protected]>2026-03-01 21:38:26 -0800
commitdb98193fc45b4029f700f8478b6fceb805235505 (patch)
treec387d0b116c5e6a5dec27fe71503096000f2cd39 /src
parentc4a5498968b531b3965b347ed6b2b744a6cea7a3 (diff)
downloadcoinos-ui-db98193fc45b4029f700f8478b6fceb805235505.tar.gz
coinos-ui-db98193fc45b4029f700f8478b6fceb805235505.zip
focus issue
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/messages/[pubkey]/+page.svelte13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/routes/(app)/messages/[pubkey]/+page.svelte b/src/routes/(app)/messages/[pubkey]/+page.svelte
index 5bd77203..67df1e00 100644
--- a/src/routes/(app)/messages/[pubkey]/+page.svelte
+++ b/src/routes/(app)/messages/[pubkey]/+page.svelte
@@ -140,14 +140,15 @@
const sendMessage = async (message: string) => {
sendError = "";
+ text = "";
+ const ta = document.getElementById("message-contents") as HTMLTextAreaElement;
+ if (ta) {
+ ta.style.height = "auto";
+ ta.focus();
+ }
try {
await libnip17.send(message, user, selectedChat);
- text = "";
- const ta = document.getElementById("message-contents") as HTMLTextAreaElement;
- if (ta) ta.style.height = "auto";
updateEvents();
- await tick();
- ta?.focus();
} catch (e: any) {
console.error("Failed to send message:", e);
sendError = $t("dm.sendFailed");
@@ -301,6 +302,8 @@
<button
class="send-btn"
disabled={!canSend || !text.trim()}
+ onmousedown={(e) => e.preventDefault()}
+ ontouchstart={(e) => e.preventDefault()}
onclick={() => sendMessage(text)}
aria-label="Send"
>