mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 10:07:22 +00:00
Make issue suggestion work for all editors (#33340)
And do not handle special keys when the text-expander popup exists
This commit is contained in:
@ -184,8 +184,13 @@ function handleNewline(textarea: HTMLTextAreaElement, e: Event) {
|
||||
triggerEditorContentChanged(textarea);
|
||||
}
|
||||
|
||||
function isTextExpanderShown(textarea: HTMLElement): boolean {
|
||||
return Boolean(textarea.closest('text-expander')?.querySelector('.suggestions'));
|
||||
}
|
||||
|
||||
export function initTextareaMarkdown(textarea) {
|
||||
textarea.addEventListener('keydown', (e) => {
|
||||
if (isTextExpanderShown(textarea)) return;
|
||||
if (e.key === 'Tab' && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
||||
// use Tab/Shift-Tab to indent/unindent the selected lines
|
||||
handleIndentSelection(textarea, e);
|
||||
|
Reference in New Issue
Block a user