Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Extra newlines added to text pasted between two Draft editors. #1389

@flarnie

Description

@flarnie

Do you want to request a feature or report a bug?
This is a bug.

What is the current behavior?
Newlines are added to internal copied text.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/.

This can be reproduced with the 'rich' example:

  1. Write some text with an empty newline between blocks. For example:
hello world

foo bar baz
  1. Copy and paste all of that text, including the empty newline, into a rich text editor in a separate tab.
  2. Notice there are extra newlines in the pasted output, like so:
hello world

foo bar baz

Example:
screen shot 2017-09-18 at 12 09 27 pm

What is the expected behavior?

There should be only as many newlines as were present in the copied text.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
This is on the master branch, so 0.10.2+, and I saw it in Chrome, Safari, and Firefox.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions