Skip to content

Content Model: Fix editing with default format issue#1773

Merged
JiuqingSong merged 3 commits into
masterfrom
u/jisong/editorimprove
May 4, 2023
Merged

Content Model: Fix editing with default format issue#1773
JiuqingSong merged 3 commits into
masterfrom
u/jisong/editorimprove

Conversation

@JiuqingSong

Copy link
Copy Markdown
Collaborator

This changes fix several issue related to default format and content model editing.

  1. When delete everything from PickerPlugin, we will let browser/other plugins (for Content Model, ContentModelEditPlugin) to delete the element, to avoid leaving an empty DIV/SPAN that cannot hold focus.
  2. When delete/backspace when there is nothing to delete, return isChanged=true from deleteSelections so that outer function will prevent default behavior of delete, to avoid delete last DIV/SPAN and cause an empty editor
  3. When type directly under editor content DIV, set a pending format as default format then ContentModelFormatPlugin will apply this default format to current segment
  4. applyPendingFormat will convert current implicit paragraph to non-implicit, so that it will render DIV element to let it hold focus. This can fix the problem when type directly before/after a table, then a new paragraph will be created.

Related bugs:
#203168 font changes after I delete an @name
#195796 When writing 2 lines below a loop component, the font style of text change

@JiuqingSong
JiuqingSong marked this pull request as ready for review May 3, 2023 21:40
@JiuqingSong
JiuqingSong merged commit fbb467a into master May 4, 2023
@JiuqingSong
JiuqingSong deleted the u/jisong/editorimprove branch May 4, 2023 23:36
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