Description
Steps to reproduce
- Set BlockNote as the default WYSIWYG editor, with realtime editing enabled.
- Create a class with two TextArea properties using the WYSIWYG editor, and add an object of that class to a page.
- Edit the object (object editor or inline form edit mode) and type different content in the two properties.
Expected
Each property has its own content.
Actual
Both editors show the same content: what is typed in one appears in the other, and both properties are saved with it.
Cause
All the BlockNote editors of a page join the same realtime collaboration session, which is identified by the edited document and its locale. Inside that session, each editor binds to the shared fragment doc.getXmlFragment(name), where name defaults to content because the XWiki integration doesn't pass the edited field name. All the editors of the page therefore edit the same shared content. Each editor should use its own fragment, named after the form field it edits.
The issue probably also affects page content edited together with a TextArea property in inline form edit mode.