-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Pasting an element that cannot be inserted into table moves the selection #1380
Comments
☝️ I have noticed the same behaviour on Safari@iOS. |
Still reproducible when pasting a table into a table. |
Currently I was able to find out the reason of such situation:
|
OK after more fidling with this. Basically I see a flaw in AFAICS it tries to break elements up to so limit element and it does it pretty well but fails when allowedElement is above limit element - like in this case. We have:
In such scenario we shouldn't do paste as the schema disallow to paste there. Also removing anything (special case but anyway) if we cannot paste is also wrong. Probably it is safe to remove empty node if and only if it's parent is |
ps.: it looks like it fixes the issue, but it might need tests for previous special cases (most likely empty paragraph). |
Thx for suggestion. I've implement it and it seems to work fine. |
Fix: Selection will not change during forbidden copy-paste operation inside table cell. Closes ckeditor/ckeditor5#1380.
Is this a bug report or feature request? (choose one)
🐞 Bug report
💻 Version of CKEditor
Latest master.
📋 Steps to reproduce
https://www.youtube.com/watch?v=ZVv7UMQPEWk
✅ Expected result
The selection won't move.
❎ Actual result
Selection is moved to previous or next cell.
📃 Other details that might be useful
I could do it on Firefox and Chrome.
The text was updated successfully, but these errors were encountered: