Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

When selection covers just a mention and the user adds a new line, no new line is added #906

Open
jmartinesp opened this issue Dec 13, 2023 · 0 comments

Comments

@jmartinesp
Copy link
Contributor

Problem

When the composer's selection wraps only a mention and enter() is received, instead of adding a new line, the mention is removed.

Steps to reproduce

// Before:
Test {<a data-mention-type="user" href="https://matrix.to/#/@bob:matrix.org" contenteditable="false">@bob</a>}| more
// After pressing enter:
<p>Test  |more </p><p> </p>

This is obviously not the required behavior. I think it can be avoided by wrapping the contents of the root node inside a paragraph first, but that would also change how pressing enter works in lots of other cases, so it's not a quick fix.

Related issues

#903

Proposed solution

Re-work a bit how do_enter() works when the root node for mentions when they're not inside paragraphs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant