Unable to set readonly mode
See original GitHub issueWhat is the current behavior?
Missing or undocumented API for setting readonly mode.
What is the expected behavior?
A way to toggle readonly mode
I’ve followed the example for the react integration https://www.tiny.cloud/docs/integrations/react/
But now I would like a button on the page to toggle the editor from readonly to edit mode. Is there a way to do this? I found this resource, but it doesn’t work https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@readonly/
In codesandbox: https://codesandbox.io/s/tinymcereact-fqwj8?file=/src/index.js
I’ve also tried using window.tinymce.activeEditor.mode.set('readonly');
to set readonly, but it has no effect.
Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-react
?
I am using react": “16.13.1” and @tinymce/tinymce-react": "^3.6.0 in Chrome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi kaplantm,
As already pointed out the correct method to set TinyMCE as readonly in the react integration is to use the
disabled
prop.The documentation is here: https://www.tiny.cloud/docs/integrations/react/#disabled
hi Tiny-James, how can I set
disable
, but my user still can comment?