-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for adding and removing roots from multi-root editor after it was initialized #13388
Comments
new roots can be added, but can't be removed. Additionally detaching root from dom element does not detach observers |
#13141 here's reported issue |
Thanks for bringing up this issue, I haven't seen it while searching for "multi-root" keyword. We want to simplify this process, so that multi-root feels natural and there's API that will do most of the work for you. |
i'm super excite about it. we have to make a lot of workarounds, e.g. hiding roots instead of deleting them. it's pretty painful |
Feature (engine): Introduced `model.Writer#addRoot()` and `model.Writer#detachRoot()`. Model roots can now be dynamically added to or detached from the document. All content gets removed from a detached root, and new content cannot be inserted, as long as the root is detached. Closes #13388. Feature (engine): Introduced `Differ.getChangedRoots()` which returns roots added or detached since last differ reset. `Differ#isEmpty` and `Differ#hasDataChanges()` will return `true` if a root was added or detached. Other: Introduced `Observer#stopObserving()` to allow for proper removal of DOM editable elements from the editor. Other (ui): Introduced `EditorUI#removeEditableElement()`. Other (engine): `model.Document#getRootNames()` now returns only attached roots by default. `includeDetached` parameter was introduced to enable returning detached roots as well. Other (engine): Introduced `RootOperation`. Other (engine): `model.DocumentFragment#isAttached` was introduced for compatibility reasons. It always returns `false`. Internal (multi-root-editor): Introduced API which allows for adding and removing roots and editable areas.
馃摑 Provide a description of the new feature
Currently, the roots' structure for multi-root is static, i.e., new roots cannot be added after the editor was initialized. Similarly, already exisiting roots cannot be removed.
This makes multi-roots very limiting in how they can be used.
Some important notes:
Related ticket / duplicates: #12235, #6291
The text was updated successfully, but these errors were encountered: