-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8478 from ckeditor/i/8328
Fix (html-embed): Fixed saving the widget content after it lost the selection. Closes #8328.
- Loading branch information
Showing
5 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/ckeditor5-html-embed/tests/manual/tickets/8328/1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div id="editor"> | ||
<p>Sample text</p> | ||
<div class="raw-html-embed"> | ||
Text inside HTML embed widget | ||
</div> | ||
</div> |
26 changes: 26 additions & 0 deletions
26
packages/ckeditor5-html-embed/tests/manual/tickets/8328/1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals window, document, console */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; | ||
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; | ||
import HtmlEmbed from '../../../../src/htmlembed'; | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#editor' ), { | ||
plugins: [ ArticlePluginSet, HtmlEmbed ], | ||
toolbar: [ | ||
'heading', '|', 'bold', 'italic', 'link', '|', | ||
'bulletedList', 'numberedList', 'blockQuote', 'insertTable', '|', | ||
'undo', 'redo', '|', 'htmlEmbed' | ||
] | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
21 changes: 21 additions & 0 deletions
21
packages/ckeditor5-html-embed/tests/manual/tickets/8328/1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## Can't save an HTML embed after pasting a text from the editor [#8328](https://github.com/ckeditor/ckeditor5/issues/8328) | ||
|
||
### Scenario 1 | ||
1. Click on `Edit source` button in the existing HTML embed widget. | ||
2. Select the text above the widget - this removes the selection from the HTML embed. | ||
3. Copy selected text. | ||
4. Paste it to the HTML embed. | ||
5. Save changes. | ||
|
||
**Expected result**: Copied text is saved. | ||
|
||
### Scenario 2 | ||
1. Insert new HTML embed widget below the existing one. | ||
2. Click on `Edit source` button in the first HTML embed. | ||
3. Click on `Edit source` button in the second HTML embed. | ||
4. Make sure that the **second** HTML embed is currently selected. | ||
5. Type some text in the **first** HTML embed and save changes. | ||
6. Make sure that the **first** HTML embed is currently selected. | ||
7. Type some text in the **second** HTML embed and save changes. | ||
|
||
**Expected result**: Typed text is saved in the appropriate HTML embed. |