Skip to content

Comments

Fix 341291: Enter key does not work after an inline entity under a list#2996

Merged
JiuqingSong merged 2 commits intomasterfrom
u/jisong/341291
Apr 14, 2025
Merged

Fix 341291: Enter key does not work after an inline entity under a list#2996
JiuqingSong merged 2 commits intomasterfrom
u/jisong/341291

Conversation

@JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Apr 12, 2025

Repro:

<ol start="1"><li><div style="margin: 0px;">test <span class="entityDelimiterBefore" style="font-family: Calibri; font-size: 11pt; color: rgb(0, 0, 0);"></span><span class="_Entity _EType_OWALink _EId_OWALink _EReadonly_1" contenteditable="false"><span>ENTITY</span></span><span class="entityDelimiterAfter" style="font-family: Calibri; font-size: 11pt; color: rgb(0, 0, 0);"></span></div></li></ol><!--{"type":"range","start":[1],"end":[1],"isReverted":false,"isDarkMode":false}-->

Press ENTER.

Expect: Go to next line and generate list item "2."
Actual: Nothing happens

This is in entityDelimiter code, it incorrectly retrieve the parent block using a wrong index.
Actually, when parent block group type is ListItem, we should not handle it since it will be handled by common enter handler code

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/roosterjs-content-model-core/lib/corePlugin/entity/entityDelimiterUtils.ts:341

  • [nitpick] The change to use path[0] assumes that the first element of the path is always the intended parent block. Please verify that this index reliably represents the correct parent in all cases, and consider renaming the variable to reflect its specific role if needed.
selectionBlockParent = path[0];

@JiuqingSong JiuqingSong merged commit 6303477 into master Apr 14, 2025
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/341291 branch April 14, 2025 20:20
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