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

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

Open
flarnie opened this issue Sep 18, 2017 · 1 comment
Open

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

flarnie opened this issue Sep 18, 2017 · 1 comment
Labels

Comments

@flarnie
Copy link
Contributor

flarnie commented Sep 18, 2017

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.

@flarnie flarnie added the bug label Sep 18, 2017
ukrbublik added a commit to ukrbublik/draft-js-mod that referenced this issue Jan 8, 2018
@thibaudcolas
Copy link
Contributor

#1784 fixes this. If you want to address this in your project right away without forking, I added the details at the end of the PR.

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

No branches or pull requests

2 participants