From d6a4d3dab62f2a7a1cb884bf0e14c443a96935b2 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 21 Nov 2024 18:08:51 +0400 Subject: [PATCH 1/2] Pass options in setSelected --- packages/core/src/editor/model/Editor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/editor/model/Editor.ts b/packages/core/src/editor/model/Editor.ts index 9e3b0b0fca..fe2d85e131 100644 --- a/packages/core/src/editor/model/Editor.ts +++ b/packages/core/src/editor/model/Editor.ts @@ -555,19 +555,19 @@ export default class EditorModel extends Model { if (!isUndefined(min)) { while (min !== index) { - this.addSelected(coll.at(min)); + this.addSelected(coll.at(min), opts); min++; } } if (!isUndefined(max)) { while (max !== index) { - this.addSelected(coll.at(max)); + this.addSelected(coll.at(max), opts); max--; } } - return this.addSelected(model); + return this.addSelected(model, opts); } !multiple && this.removeSelected(selected.filter((s) => s !== model)); From d37ae63b1f18b31f8cdfd477d6640a98a71a5162 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 22 Nov 2024 17:54:16 +0400 Subject: [PATCH 2/2] Allow force sync from custom RTE --- .../src/dom_components/view/ComponentTextView.ts | 16 +++++++++------- packages/core/src/rich_text_editor/index.ts | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/packages/core/src/dom_components/view/ComponentTextView.ts b/packages/core/src/dom_components/view/ComponentTextView.ts index 8fcd424936..2c8c9bf029 100644 --- a/packages/core/src/dom_components/view/ComponentTextView.ts +++ b/packages/core/src/dom_components/view/ComponentTextView.ts @@ -1,6 +1,6 @@ import { bindAll } from 'underscore'; import { AddOptions, DisableOptions, ObjectAny, WithHTMLParserOptions } from '../../common'; -import RichTextEditorModule from '../../rich_text_editor'; +import RichTextEditorModule, { RteDisableResult } from '../../rich_text_editor'; import RichTextEditor from '../../rich_text_editor/model/RichTextEditor'; import { off, on } from '../../utils/dom'; import { getComponentModel } from '../../utils/mixins'; @@ -115,14 +115,17 @@ export default class ComponentTextView { pfx: string; toolbar!: HTMLElement; @@ -400,14 +404,18 @@ export default class RichTextEditorModule extends Module