shift + enterでも改行
This commit is contained in:
parent
861c3f3a0d
commit
73f5dfebca
1 changed files with 4 additions and 7 deletions
|
@ -143,17 +143,14 @@ function onDrop(ev: DragEvent): void {
|
|||
|
||||
function onKeydown(ev: KeyboardEvent) {
|
||||
typing();
|
||||
let sendOnEnter = localStorage.getItem('enterSendsMessage') === 'true' || defaultStore.state.enterSendsMessage;
|
||||
if (sendOnEnter) {
|
||||
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey)) {
|
||||
if (defaultStore.state.enterSendsMessage) {
|
||||
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey || ev.shiftKey)) {
|
||||
textEl.value += '\n';
|
||||
}
|
||||
else if (ev.key === 'Enter' && !ev.shiftKey && !('ontouchstart' in document.documentElement) && canSend) {
|
||||
} else if (ev.key === 'Enter' && !ev.shiftKey && !('ontouchstart' in document.documentElement) && canSend) {
|
||||
ev.preventDefault();
|
||||
send();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) {
|
||||
ev.preventDefault();
|
||||
send();
|
||||
|
|
Loading…
Reference in a new issue