slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.27k stars 3.36k forks source link

Can't copy content from quill editor with readOnly set to true #4356

Open player2I0 opened 1 month ago

player2I0 commented 1 month ago

I'm creating a few quill editors with readOnly set to true when the page starts. But for some reason, it is impossible to copy content from these divs (I press 'copy to clipboard' but it doesn't copy). An yet, with divs with readOnly set to false, it is completely possible to copy content.

Steps for Reproduction

  1. Create a few quill divs on page starts and set their readOnly to false.

Expected behavior:

Ability to copy content from readOnly divs.

Actual behavior:

Content doesn't go to the clipboard.

Platforms:

Browser: Google Chrome 124.0.6367.91 (Official Build) (64-bit) OS: Debian 12

Version:

2.0.0

sahar2339 commented 2 weeks ago

The workaround for me is to disable the copy interception:

quill.clipboard.onCaptureCopy = () => {}