SHA256
Finalize DM docs and queue routing
This commit is contained in:
@@ -1392,22 +1392,10 @@ export function render({ navigate, route }) {
|
||||
if (!emojiPickerOpen || form.contains(event.target)) return;
|
||||
closeEmojiPicker();
|
||||
});
|
||||
// Enter — отправить; Ctrl+Enter — перенос строки.
|
||||
// Enter — отправить; Shift+Enter и Ctrl+Enter — перенос строки.
|
||||
input?.addEventListener('keydown', async (event) => {
|
||||
if (event.key !== 'Enter') return;
|
||||
if (event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
const start = Number(input.selectionStart ?? input.value.length);
|
||||
const end = Number(input.selectionEnd ?? input.value.length);
|
||||
const value = String(input.value || '');
|
||||
input.value = `${value.slice(0, start)}\n${value.slice(end)}`;
|
||||
const nextPos = start + 1;
|
||||
try {
|
||||
input.setSelectionRange(nextPos, nextPos);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
autoResizeComposer(input);
|
||||
if (event.shiftKey || event.ctrlKey) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user