Skip to content

Commit

Permalink
Use a different change source for keyboard formatting event (#2799)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong authored Sep 16, 2024
1 parent 5480a82 commit 7ef8730
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { deleteEmptyQuote } from './deleteSteps/deleteEmptyQuote';
import { deleteSelection, normalizeContentModel, runEditSteps } from 'roosterjs-content-model-dom';
import { handleEnterOnList } from './inputSteps/handleEnterOnList';
import { handleEnterOnParagraph } from './inputSteps/handleEnterOnParagraph';
import {
ChangeSource,
deleteSelection,
normalizeContentModel,
runEditSteps,
} from 'roosterjs-content-model-dom';
import type { IEditor } from 'roosterjs-content-model-types';

/**
Expand Down Expand Up @@ -49,6 +54,7 @@ export function keyboardEnter(
{
rawEvent,
scrollCaretIntoView: true,
changeSource: ChangeSource.Keyboard,
}
);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { deleteSelection, isModifierKey, normalizeContentModel } from 'roosterjs-content-model-dom';
import {
ChangeSource,
deleteSelection,
isModifierKey,
normalizeContentModel,
} from 'roosterjs-content-model-dom';
import type { DOMSelection, IEditor } from 'roosterjs-content-model-types';

/**
Expand Down Expand Up @@ -32,6 +37,7 @@ export function keyboardInput(editor: IEditor, rawEvent: KeyboardEvent) {
{
scrollCaretIntoView: true,
rawEvent,
changeSource: ChangeSource.Keyboard,
}
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-dom';
import { handleTabOnList } from './tabUtils/handleTabOnList';
import { handleTabOnParagraph } from './tabUtils/handleTabOnParagraph';
import { handleTabOnTable } from './tabUtils/handleTabOnTable';
import { handleTabOnTableCell } from './tabUtils/handleTabOnTableCell';
import { setModelIndentation } from 'roosterjs-content-model-api';
import {
ChangeSource,
getOperationalBlocks,
isBlockGroupOfType,
} from 'roosterjs-content-model-dom';
import type {
ContentModelListItem,
ContentModelTableCell,
Expand Down Expand Up @@ -37,6 +41,7 @@ export function keyboardTab(editor: IEditor, rawEvent: KeyboardEvent) {
},
{
apiName: 'handleTabKey',
changeSource: ChangeSource.Keyboard,
}
);
return true;
Expand Down

0 comments on commit 7ef8730

Please sign in to comment.