This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
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 #896 from ckeditor/t/887
Fix: Renderer should not change the native selection if the one it's about to render is visually similar to the current one. Closes #887. Closes #880.
- Loading branch information
Showing
8 changed files
with
417 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="editor"> | ||
<p>This is an <strong>editor</strong> instance.</p> | ||
</div> |
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,27 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/* globals console, window, document */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classic'; | ||
import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials'; | ||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; | ||
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; | ||
|
||
ClassicEditor.create( document.querySelector( '#editor' ), { | ||
plugins: [ EssentialsPreset, Paragraph, Bold ], | ||
toolbar: [ 'undo', 'redo' ] | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
|
||
editor.editing.view.on( 'selectionChange', () => { | ||
editor.document.enqueueChanges( () => {} ); | ||
console.log( 'selectionChange', ( new Date() ).getTime() ); | ||
} ); | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
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,14 @@ | ||
## Renderer - infinite `selectionChange` event | ||
|
||
Place the selection like this: | ||
|
||
``` | ||
This is {an <strong>editor}</strong> instance. | ||
``` | ||
|
||
(it must end at the end of the inline style) | ||
|
||
**Expected**: | ||
|
||
* Every time selection is changed, console log with `selectionChange` is printed once. | ||
* While creating selection from **2.**, there might be `renderer-selection-similar` warning visible in the console. |
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,3 @@ | ||
<div id="editor"> | ||
<p>This is an <strong>editor</strong> instance.</p> | ||
</div> |
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,22 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/* globals console, window, document */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classic'; | ||
import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials'; | ||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; | ||
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; | ||
|
||
ClassicEditor.create( document.querySelector( '#editor' ), { | ||
plugins: [ EssentialsPreset, Paragraph, Bold ], | ||
toolbar: [ 'undo', 'redo' ] | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
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,10 @@ | ||
## Renderer - MacOS accent balloon on inline element boundary | ||
|
||
1. Place the selection like this: | ||
|
||
`This is an <strong>editor{}</strong> instance.` | ||
2. Open MacOS accent balloon (e.g. long `a` press). | ||
3. Navigate through the balloon panel using arrow keys. | ||
|
||
**Expected**: It is possible to navigate with arrow keys inside the MacOS balloon panel. While navigating, there | ||
might be `renderer-selection-similar` warning visible in the console. |
Oops, something went wrong.