ui-tinymce
ui-tinymce copied to clipboard
Editor does not respect ng-disabled
Hi,
I am having issues getting this directive to follow ng-disabled. There seems to be an issue where in the toggleDisable function, the tinyInstance variable is always null.
Plunkr: https://plnkr.co/edit/7gnFLWZQkWtKhN68LJTs?p=preview
This shows the editor is not read only, despite the expression evaluating to true.
Additionally, even with a checkbox to control the value of test2: https://plnkr.co/edit/QDuPfwAHr7mxfu3daMB7?p=preview
Here, the editor should start read only but does not, and only when un-checking and re-checking the checkbox does the editor go to read only.
Lastly, even in read only, it is possible to delete content but not add content to the editor, also the controls are not greyed out on the toolbar.
Is there something I am doing wrong that means the editor is behaving differently to than if I specify readonly through the editor setup options?
Thanks for posting this, looks to be a legitimate issue still.
Looks like this is related to #74.
Feel free to put up a PR if you already have a fix with appropriate tests, if not I will try to get to it as soon as possible.
The more I look this seems to be an issue with TinyMCE and not this library.
What we are currently doing to disable editing seems to be the suggested way of disabling the editor. This has the known side effect of not disabling the buttons on the editor, and a bug where you can still delete the content.
It doesn't seem that TinyMCE gives us a great way to disable changing the content in the editor as well as making all of the buttons looked disabled.
I'm going to spend a bit more time researching and most likely open a bug/feature request with TinyMCE.
Will leave this bug open until a decision has been made.
Seems to work as expected if you use
tinyInstance.setMode('readonly');
instead of
tinyInstance.getBody().setAttribute('contenteditable', false);
tinyInstance.setMode('readonly');
This works