stable
Clone or download
Fixes request #41100 Cursor go back into title If the editor switch to edit mode (`is_edit_mode`), it is that the content of the editor changed. If the editor switch to non edit mode (`!is_edit_mode`), it is one of the following case: 1. We have clicked on cancel button 2. We have added a modification and deleted it (like pressing Enter and then Backsapce) In the previous code we put a watcher on `is_edit_mode` and when it changes to `false` (not in edit mode), then we reset the whole editor thinking of being in case 1 (clicked on cancel button). But we missed the case 2 (added changes and deleted it), so in this case it also reset the whole editor and moved back to the beginning of the title. To avoid this, we can check if the editor has changed before triggering the reset, and so: - If the edit mode is `false` and the code has changed, then it is due to the cancel button (case 1) and it has to reset. - Otherwise, it is due to a modification added then removed (case 2), so there is nothing to do. How to test: -- In a section of your Artidoc, add a letter and then remove it. -> It should not go the beginning of the title Change-Id: Ie6093a0e2c5bc91f95cc91129e553ba44aae5880
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/artidoc/scripts/artidoc/src/components/print/SectionPrinterVersion.vue | +1 | −0 | Go to diff View file |
M | plugins/artidoc/scripts/artidoc/src/components/section/SectionContent.vue | +8 | −2 | Go to diff View file |
M | plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescription.test.ts | +1 | −0 | Go to diff View file |
M | plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescription.vue | +2 | −0 | Go to diff View file |
M | plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescriptionEditorProseMirror.vue | +2 | −8 | Go to diff View file |
M | plugins/artidoc/scripts/artidoc/src/composables/useEditorSectionContent.ts | +5 | −2 | Go to diff View file |
M | plugins/artidoc/scripts/artidoc/src/helpers/stubs/SectionEditorStub.ts | +1 | −0 | Go to diff View file |