Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.
This repository was 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

@jmartinesp

Description

@jmartinesp

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions