Prevent prefix continuation if currently a text expander popup is open

This fixes that mentions and emoji autocompletion was broken in e.g. a
list, because the list handling take presidency over the text expansion.
This commit is contained in:
Beowulf 2025-01-17 18:22:43 +01:00
parent e35afe475a
commit 276ef10dd5
No known key found for this signature in database
GPG key ID: 44225F5F2792841D
2 changed files with 28 additions and 0 deletions

View file

@ -99,6 +99,8 @@ class ComboMarkdownEditor {
e.target._shiftDown = true;
}
if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey && !e.altKey) {
// Prevent special line break handling if currently a text expander popup is open
if (this.textarea.hasAttribute('aria-expanded')) return;
if (!this.breakLine()) return; // Nothing changed, let the default handler work.
this.options?.onContentChanged?.(this, e);
e.preventDefault();