Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Correct moving selection during invalid copy-paste #1742

Merged
merged 3 commits into from
Jun 10, 2019
Merged

Conversation

msamsel
Copy link
Contributor

@msamsel msamsel commented May 30, 2019

Suggested merge commit message (convention)

Fix: Moving selection during forbidden copy-paste operation (pasting table into empty table cell). Closes ckeditor/ckeditor5#1380.

@jodator jodator self-requested a review June 5, 2019 08:22
Copy link
Contributor

@jodator jodator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - few minor changes would be nice.

@@ -562,7 +562,7 @@ class Insertion {

// Special case – parent is empty (<p>^</p>).
// We can remove the element after moving insertion position out of it.
if ( parent.isEmpty ) {
if ( parent.isEmpty && parent.parent === allowedIn ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an explanation about parent.parent == allowedIn

@@ -1254,6 +1254,43 @@ describe( 'DataController utils', () => {
expect( getData( model ) ).to.equal( '<limit>ab[]foo</limit>' );
expect( stringify( root, affectedRange ) ).to.equal( '<limit>[ab]foo</limit>' );
} );

describe( 'when allowed elements is somewhere above limit', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go with: 'when allowed element is above limit element in document tree'.

@jodator jodator merged commit ab15b17 into master Jun 10, 2019
@jodator jodator deleted the t/ckeditor5/1380 branch June 10, 2019 09:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants