facebook/lexical

Bug: Pasting over linebreaks puts content in different places

Open

#4 815 ouverte le 24 juil. 2023

Voir sur GitHub
 (8 commentaires) (10 réactions) (0 assignés)JavaScript (1 349 forks)batch import
contribution-weekcopy+pastegood first issue

Métriques du dépôt

Stars
 (16 523 stars)
Métriques de merge PR
 (Merge moyen 2j 16h) (103 PRs mergées en 30 j)

Description

When pasting some text with at least two containers/paragraphs on two linebreaks, the text being pasted gets split, the first container (heading) gets on the correct location, and the remaining text gets pasted after the next paragraph.

Lexical version:

Steps To Reproduce

  1. Hit two Shift-Enter inside a paragraph on Lexical's editor
  2. Try pasting a text having two containers, a heading and a paragraph for example

https://github.com/facebook/lexical/assets/5845160/321fe7a4-56b7-488d-a851-7f6d16174514

Lexical playground exports: Playground 2023-07-24T13_10_22.747Z.lexical.zip

The current behavior

The first line of the text being pasted gets to the correct location, and the remaining text gets appended to the end of the paragraph.

The expected behavior

All the text gets inserted to the correct location, preferably keeping the same formatting from where it was copied.

Guide contributeur