Opened 8 years ago
Closed 6 years ago
#16813 closed Bug (fixed)
editor.getSelectedHtml returns incorrect data
Reported by: | DmitryKrekota | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Selection | Version: | 4.7.2 |
Keywords: | Firefox Webkit | Cc: |
Description
Because of clipboard plugin use editor.getSelectedHtml, this bug can reproduce with copy/paste. I also created plugin "bugdemo" to show how to repriduce the bug. You can download ckeditor with plugin "bugdemo" here: https://drive.google.com/file/d/0Bxtv10NlSOEbenRvWUtJeGhqV2c/view?usp=sharing Also, see vidio record with bug reproducing: https://drive.google.com/file/d/0Bxtv10NlSOEbVU9POE9RenZkblE/view
Steps to reproduce ("clipboard" plugin)
- download zip archive https://drive.google.com/file/d/0Bxtv10NlSOEbenRvWUtJeGhqV2c/view?usp=sharing , exstract it and open samples/index.html
- Select text "Lorem"
- Open and close any dropdown menu
- Copy selected text "Lorem" by clicking 'copy' button in toolbar.
- Paste selected text by clicking 'paste' button in toolbar. (CTRL + V)
Expected result ("clipboard" plugin)
Inserted text is "Lorem"
Actual result ("clipboard" plugin)
Inserted text is "Lorem ipsum dolor sit amet. Hello CKE" (all first text node)
Steps to reproduce (custom "bugdemo" plugin)
- download zip archive https://drive.google.com/file/d/0Bxtv10NlSOEbenRvWUtJeGhqV2c/view?usp=sharing , exstract it and open samples/index.html
- Select text "Lorem"
- Open and close any dropdown menu
- Click 'owl' button in toolbar.
Expected result (custom "bugdemo" plugin)
See text "~Lorem~"
Actual result (custom "bugdemo" plugin)
See text "~Lorem ipsum dolor sit amet. Hello CKE~"
Other details (browser, OS, CKEditor version, installed plugins)
Reproduced only in CKEditor Inline Editing.
Environment: Windows 7, Chrome 56.
Attachments (1)
Change History (6)
Changed 8 years ago by
Attachment: | ckeditor_bug_example.rar added |
---|
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Keywords: | Firefox Webkit added; getSelectedHtml Selection removed |
---|---|
Status: | new → confirmed |
Version: | 4.6.2 → 4.5.0 |
Problem can be reproduced in Firefox and Webkit browsers. IE and Edge work fine.
I was able to reproduce it with block, inline elements and plain text (it is inside P by default). Basically you need to:
- Press New Page to clear editor contents.
- Type few words and select first one with mouse
- Click on dropdown to open it and close it with escape
- Press Ctrl+C/Ctrl+V
Result: whole text will be pasted.
comment:3 Changed 8 years ago by
Can you check my PR? https://github.com/ckeditor/ckeditor-dev/pull/316
comment:4 Changed 8 years ago by
@DmitryKrekota thanks for update, we're currently under heavy load thus having little time to go through PRs. We'll surely review it as soon as get back to PRs.
comment:5 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
Version: | 4.5.0 → 4.7.2 |
This issue has been fixed in CKEditor 4.7.2, see https://github.com/ckeditor/ckeditor-dev/pull/316#issuecomment-407010594.
My pull request for fix the bug: https://github.com/ckeditor/ckeditor-dev/pull/316