Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.15.0 - Paste overwrites existing text #4301

Closed
laurinkeithdavis opened this issue Sep 26, 2020 · 9 comments
Closed

4.15.0 - Paste overwrites existing text #4301

laurinkeithdavis opened this issue Sep 26, 2020 · 9 comments
Assignees
Labels
plugin:clipboard The plugin which probably causes the issue. regression This issue is a regression. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@laurinkeithdavis
Copy link

laurinkeithdavis commented Sep 26, 2020

Reproduction steps

  1. Copy this text line.
  2. Open https://jsfiddle.net/laurin1/x45pjdef/
  3. Paste copied line into the editor.
  4. Press enter.
  5. Paste the same line again.
  6. Repeat 5-6 multiple times.

Expected

Every time a new line is pasted.

Actual

Pasted text replaces the line above.

Other

The issue is reproducible with enter mode CKEDITOR.ENTER_DIV option and when the editor is initialized totally empty.

@laurinkeithdavis
Copy link
Author

laurinkeithdavis commented Sep 26, 2020

I have found a clue! The issue only occurs if we use enterMode = 3 (<div> instead of <p>). If we switch back to default, the issue does not occur.

Also, if I switch source, put any text underneath the <div>text</div>, then the issue does not occur.

@laurinkeithdavis
Copy link
Author

laurinkeithdavis commented Sep 26, 2020

I can reproduce it consistently now. Sometimes it stops happening, but if I clear browser history for the last hour, close and reopent the browser, paste text, hit enter, paste text, and it happens every time.

@laurinkeithdavis
Copy link
Author

Also, seems like it could be related to the change made here:

#2776

@laurinkeithdavis
Copy link
Author

laurinkeithdavis commented Sep 27, 2020

I'm trying to debug the issue manually, but I can't get CKEditor to load properly in source format so that can modify the code and test. Editor appears to load (no JS errors), but is not editable.

@jacekbogdanski
Copy link
Member

@laurin1 could you provide a sample demo with the issue using online editor, like one of:

@laurinkeithdavis
Copy link
Author

Geez, I don't know if that is possible. These are extremely complex pages that the CKEditor is built into, all dynamically created using PHP, but I will try.

@laurinkeithdavis laurinkeithdavis changed the title 4.15.0- Paste overwrites existing text 4.15.0 - Paste overwrites existing text Sep 29, 2020
@laurinkeithdavis
Copy link
Author

laurinkeithdavis commented Oct 1, 2020

Actually, it does it with even a very basic example:

https://jsfiddle.net/laurin1/x45pjdef/

Copy this word:

attendance

Paste it in the editor, then press enter and paste it again, press enter, paste again, ad infinitum...always overwrites.

@jacekbogdanski
Copy link
Member

jacekbogdanski commented Oct 2, 2020

I can reproduce the issue, thanks for the demo! It seems like the editor should be initialized empty, otherwise, it seems to work correctly. I will update the top post with reproduction steps.

@jacekbogdanski jacekbogdanski added status:confirmed An issue confirmed by the development team. plugin:clipboard The plugin which probably causes the issue. labels Oct 2, 2020
@Comandeer Comandeer self-assigned this Oct 20, 2020
@f1ames f1ames added size:S and removed size:M labels Nov 16, 2020
@f1ames f1ames added regression This issue is a regression. size:M and removed size:S labels Dec 7, 2020
@f1ames f1ames added size:S and removed size:M labels Jan 18, 2021
@CKEditorBot
Copy link
Collaborator

Closed in #4356

@CKEditorBot CKEditorBot added this to the 4.16.1 milestone Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:clipboard The plugin which probably causes the issue. regression This issue is a regression. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

5 participants