Skip to content
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

Do not fire clipboardInput event when editor is read-only #2679

Closed
oskarwrobel opened this issue Jun 4, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-clipboard#47
Closed
Assignees
Labels
package:clipboard type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@oskarwrobel
Copy link
Contributor

When the editor is read-only paste pipeline should be disabled for the entire editor. It should be not possible to paste anything to the editor with no exception. So instead of checking if the editor is readonly in all clipboardInput listeners https://github.com/ckeditor/ckeditor5-clipboard/blob/ae4ea8586a272e7e5486fc5ff9d62d427992eb57/src/clipboard.js#L137-L142 we should stop this event as soon as possible.

We already have an issue with image pasting. It's possible to paste an image even when the editor is read-only because of two things:

  • image upload after paste does not use ImageUploadCommand (by design)
  • missing isReadOnly check

https://github.com/ckeditor/ckeditor5-image/blob/6908ec6bcdce8e382b34e65fb6d62aa5c860a0b4/src/imageupload/imageuploadediting.js#L49
BTW the comment above this line of code is outdated.

@oskarwrobel oskarwrobel self-assigned this Jun 4, 2018
Reinmar referenced this issue in ckeditor/ckeditor5-clipboard Jun 4, 2018
Fix: Disabled the entire clipboard input pipeline when the editor is read-only. Closes #48.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-clipboard Oct 9, 2019
@mlewand mlewand added this to the iteration 18 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:improvement This issue reports a possible enhancement of an existing feature. package:clipboard labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:clipboard type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
2 participants