- Issue created by @gordon
- 🇦🇺Australia gordon Melbourne
I have done more testing of this, and I have found that this is more cosmetic as if you submit changes when the textarea is disabled, Drupal will just throw away the changes and keep the current changes.
However from the user perspective it is not doing the expected outcome. You are able to enter content or make changes, and then these are not saved.
- Status changed to Postponed: needs info
over 1 year ago 12:05pm 22 June 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Interesting!
Looks like we never made this work in CKEditor 4 either: 🐛 ckeditor can't be set enabled / disabled / readonly by Form API #states Active ? Zero matches if I search the CKEditor 4 codebase for it: https://git.drupalcode.org/search?search=%23disabled&nav_source=navbar&p....
- CKEditor 4 had a read-only mode: https://ckeditor.com/docs/ckeditor4/latest/features/readonly.html. That is also not implemented in the CKEditor 4 module: https://git.drupalcode.org/search?search=readonly&nav_source=navbar&proj...
- There is an equivalent for CKEditor 5: https://ckeditor.com/docs/ckeditor5/latest/features/read-only.html. Does that demo offer what you'd expect?
Note that there's also the "readonly" attribute: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#readonly
I think we can quite easily support this, but if we managed ~7 years without it in CKEditor 4, I can't say this would be a high priority 😅 Definitely willing to review this though!
- 🇦🇺Australia gordon Melbourne
I was not aware of this in #states issue but if in the form API you set the #disabled to false as in the above example CKEditor 4 will be disabled.
- Status changed to Closed: duplicate
about 1 year ago 10:10am 3 October 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
This was fixed in 🐛 CKEditor 5 should respect Fixed !