Improvements #11272: WTextEdit / TinyMCE improvements
Support changing readonly state after editor is rendered.
Currently the readonly attribute is only correctly applied on first render. Later changes are applied on the hidden textarea, but are not applied to the tinyMCE editor.
Explicitly update the tinyMCE mode to reflect the readonly state, by adding the following code to the end of
See TinyMCE documentation: https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.editormode/#set
Note that this does not seem to work (when the editor is initially readonly), due to a bad initial readonly configuration setting. Wt uses std::string("1") and cpp17::any() (see
WTextEdit::setReadOnly), although the documented values are true and false.
See TinyMCE documentation: https://www.tiny.cloud/docs/tinymce/6/editor-important-options/#starting-the-editor-in-a-read-only-state
Correctly using true and false inside
WTextEdit::setReadOnly, resolves this issue:
if (readOnly) setConfigurationSetting("readonly", true); else setConfigurationSetting("readonly", false);