mirror of
https://github.com/coracle-social/coracle.git
synced 2024-10-01 17:31:24 +00:00
Only send message when enter is pressed with ctrl/cmd
This commit is contained in:
parent
34db1df405
commit
f5aae29582
@ -112,7 +112,13 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:body on:keydown={e => e.key === 'Escape' && modal.set(null)} />
|
||||
<svelte:body
|
||||
on:keydown={e => {
|
||||
if (e.key === 'Escape') {
|
||||
modal.set(null)
|
||||
menuIsOpen.set(false)
|
||||
}
|
||||
}} />
|
||||
|
||||
<Router {url}>
|
||||
<div use:links class="h-full">
|
||||
|
@ -91,8 +91,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
const onReplyKeyPress = e => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
const onReplyKeyDown = e => {
|
||||
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault()
|
||||
sendReply()
|
||||
}
|
||||
@ -170,7 +170,7 @@
|
||||
autofocus
|
||||
placeholder="Type something..."
|
||||
bind:value={reply}
|
||||
on:keypress={onReplyKeyPress}
|
||||
on:keydown={onReplyKeyDown}
|
||||
class="w-full p-2 text-white bg-medium
|
||||
placeholder:text-light outline-0 resize-none" />
|
||||
<div
|
||||
|
Loading…
Reference in New Issue
Block a user