Details
-
Bug
-
Resolution: Fixed
-
Major
-
18.9.0
-
Integration
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce
- Set BlockNote as the default WYSIWYG editor.
- Open a page in view mode, open the Comments tab and type a comment.
- Click "Add comment".
Expected
The comment is added.
Actual
Nothing happens, and the browser console shows Uncaught TypeError: Cannot read properties of undefined (reading 'value').
Cause
The submit handler of the comment form in comments.js reads the comment from the first textarea of the form, after firing xwiki:actions:beforeSave to let the rich editor update its form fields:
document.fire('xwiki:actions:beforeSave'); if (form.down('textarea').value != "") {
This works with CKEditor because it replaces a real textarea. BlockNote doesn't use a textarea: it outputs a div host plus hidden input fields, so form.down('textarea') is undefined. The comments JavaScript needs to read the submitted value in a way that doesn't depend on the editor, e.g. from the form field named after the comment property.
Found while looking into XWIKI-25433, which would have CKEditor drop its textarea too in standalone edit mode.
Attachments
Issue Links
- relates to
-
XWIKI-25433 Use the iframe-less CKEditor in the standalone WYSIWYG edit mode
-
- Open
-