Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
francismengMS committed Jun 5, 2024
1 parent f0b46d2 commit 4ed3e67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ export const formatContentModel: FormatContentModel = (
core.api.setContentModel(
core,
model,
hasFocus ? undefined : { ignoreSelection: true }, // If editor did not have focus before format, do not set focus after format
hasFocus
? undefined
: {
ignoreSelection: true,
shouldMaintainSelection: options?.shouldMaintainSelection,
}, // If editor did not have focus before format, do not set focus after format
onNodeCreated
) ?? undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export interface FormatContentModelOptions {
* When pass to true, scroll the editing caret into view after write DOM tree if need
*/
scrollCaretIntoView?: boolean;

/**
* When pass to true, selection is maintained even when focus is moved out of editor.
*/
shouldMaintainSelection?: boolean;
}

/**
Expand Down

0 comments on commit 4ed3e67

Please sign in to comment.