- Issue created by @endless_wander
- Assigned to Indranil Roy
- First commit to issue fork.
- Merge request !683 - adding filter to remove disabled attribute in the to-do list [#3449245] → (Open) created by dolszewski
- Issue was unassigned.
- Status changed to Needs review
4 months ago 11:12am 10 July 2024 - 🇵🇱Poland dolszewski
hello @endless_wander
I've added MR with a new filter which will remove the disabled attribute from to-do list (it will be present in the text format edit form in the section Enabled filters). Please check if it works for your case. - 🇨🇦Canada endless_wander
MR from #5 works for me. Thank you very much for adding that. The solution feels a bit strange still. What is the use-case for adding disabled checkboxes to a page? I wonder if having the checkboxes be enabled shouldn't be the default? What would be amazing is if the checkbox button within CKEditor had its own option for disabling the checkbox so that both options are available for all users directly from the editor.
- Status changed to RTBC
4 months ago 6:47am 11 July 2024 - 🇵🇱Poland dolszewski
@endless_wander
Yes, this is a workaround solution, To-Do List is a plugin provided by the core of CKEditor5, we only implement it in Drupal, so we can't easily change how it behaves, your proposed changes should be added to the official ckeditor5 repo on GitHub. - 🇨🇦Canada endless_wander
Understood. On the example page for the CKEditor plugin, the checkboxes do not insert as disabled however: https://ckeditor.com/docs/ckeditor5/latest/features/lists/todo-lists.html
- 🇵🇱Poland dolszewski
@chris@chrislavigne.com
On the demo page, there is the editor instance like in the node edit form in Drupal where checkboxes are also not disabled. - 🇨🇦Canada endless_wander
@dolszewski I'm not sure what demo page you are referring to
- 🇵🇱Poland salmonek
@chrischrislavignecom
He meant the page you linked. Checkboxes are enabled when content is being edited. However the content retrieved to save into database (editor.getData()
) will return disabled checkboxes. So it is the default behavior of CKEditor 5 itself. You can see it briefly before editor is loaded or when JS is disabled or by executingconsole.log(editor.getData())
in the developer console.This we can easily altered in Drupal with text filter, by removing
disabled
attribute on content load.
In order to have ability to save checkboxes not disabled to database the "To-do lists" CKEditor 5 plugin itself had to be changed. Such change can be requested on CKEditor 5 github https://github.com/ckeditor/ckeditor5/issues - 🇨🇦Canada endless_wander
I have created an issue with CKEditor. An easier way to check that CKEditor is creating disabled checkboxes by default is to go to their full feature example at https://ckeditor.com/docs/ckeditor5/latest/examples/builds-custom/full-f... and check the source when adding a to-do list.
- Status changed to Closed: won't fix
4 months ago 4:12am 23 July 2024 - 🇨🇦Canada endless_wander
CKEditor maintainer responded that they will not add this feature and checkboxes can only be added in "disabled" state