Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Model: Fix #2202 #2389

Merged
merged 2 commits into from
Feb 2, 2024
Merged

Content Model: Fix #2202 #2389

merged 2 commits into from
Feb 2, 2024

Conversation

JiuqingSong
Copy link
Collaborator

#2202 When we delete an entity and there is another entity after it, the existing code to reuse entity is not working, because the deleted entity is still in DOM tree, so it fail the check in "!isEntityElement(refNode)" in reuseCachedElement and cause we force insert the next entity.

To solve this, we can directly remove the entity wrapper when delete, so that when write back using Content Model, the deleted entity is not in DOM tree, then existing DOM node can be successfully reused.

@JiuqingSong JiuqingSong merged commit aae8054 into master Feb 2, 2024
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/2202 branch February 2, 2024 17:48
Andres-CT98 added a commit that referenced this pull request Feb 2, 2024
* wip

* wip

* refactor

* fix dependecies

* fix dependecies

* fix dependecies

* WIP

* add test

* add tests

* types

* add comment

* add comment

* add comment

* add comment

* add comment

* comments

* fix build

* fixes

* fixes

* refactor

* fixes

* Add shortcut support Ctrl+K for insertLink  (#2333)

* Add shortcut support Ctrl+K for insertLink

* Add metakey and alt key checks

* Add insertButton check and disable param

* add options to ribbon and decouple onButtonClick

* update

* update fix

* add break statement

* remove duplicate imports

---------

Co-authored-by: Ghanem10 <107857762+Ghanem10@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>

* Content Model: Add back ContentModelBeforePasteEvent (#2347)

* Use margin-top and bottom for list margin (#2346)

* Standalone Editor: Improve cache (3rd try) (#2344)

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* fixes

* fix test

* Fix safari selection issue (#2332)

* try fix safari selection issue

* fix content model editor, add test

* fix focus bug

* Standalone Editor: Remove dependency to old code from api and plugins package (#2349)

* Content Model: Decouple test code from old code (#2351)

* Fix demo site (#2353)

* Content Model: Fix table text color (#2359)

* Fix pending format (#2354)

* Fix pending format

* improve

* Standalone Editor: Provide a DOMHelper to allow access DOM tree (#2363)

* Fix shadow edit (#2355)

* Fix 2 shadow edit issue (#2356)

* Support unit "inch" when parse value (#2357)

* Content Model: Support inch when parse unit value

* add comment

* Code clean up: small refactor to paste code (#2365)

* Refactor paste

* add test

* Code clean up: Remove IStandaloneEditor.setContentModel (#2364)

* Add support to cursor around Block entities. (#2350)

* rotator space

* Port ContextMenu plugin (#2366)

* Port ContextMenu plugin

* add test

* Content Model: Fix 252436 (#2367)

* Content Model: Fix 252436

* add test

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Code cleanup: Remove parameter onNodeCreated (#2374)

* Code cleanup: Remove isContentModelEditor (#2371)

* Code cleanup: Remove isContentModelEditor

* add buttons

* Add `isReverted` to DOM Selection (#2368)

* add Changes

* add Tests

* fix dependencies

* address comments

* address comment

* fix after merge

* fix test

---------

Co-authored-by: Jiuqing Song <jisong@microsoft.com>

* Code cleanup: Remove NormalizeTablePlugin (#2376)

* add normalize content model

* fix build

* Code cleanup: Replace createContentModel with getContentModelCopy (#2372)

* Code cleanup: Remove isContentModelEditor

* add buttons

* Code cleanup: Replace createContentModel with getContentModelCopy

* Code cleanup: Remove get/setZoomScale (#2378)

* Code cleanup: Remove get/setZoomScale

* Add calculateZoomScale function

* improve

* Code cleanup: Move isNodeInEditor into DOMHelper (#2379)

* Code cleanup: Remove TODO (#2384)

* Add write permission to deploy action (#2383)

* Revert "Add support to cursor around Block entities. (#2350)" (#2390)

This reverts commit 7998d03.

* Content Model: Fix #2202 (#2389)

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* bump

---------

Co-authored-by: Júlia Roldi <juliaroldi@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Gani <107857762+gm-al@users.noreply.github.com>
Co-authored-by: Ghanem10 <107857762+Ghanem10@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
@JiuqingSong JiuqingSong mentioned this pull request Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants