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

Remove unused function args from LexicalUtils #2763

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/lexical/src/LexicalEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ function onInput(event: InputEvent, editor: LexicalEditor): void {
$setCompositionKey(null);
}
} else {
$updateSelectedTextFromDOM(editor, false);
$updateSelectedTextFromDOM(false);

// onInput always fires after onCompositionEnd for FF.
if (isFirefoxEndingComposition) {
Expand Down Expand Up @@ -721,7 +721,7 @@ function onCompositionEndImpl(editor: LexicalEditor, data?: string): void {
}
}

$updateSelectedTextFromDOM(editor, true, data);
$updateSelectedTextFromDOM(true, data);
}

function onCompositionEnd(
Expand Down Expand Up @@ -752,17 +752,17 @@ function onKeyDown(event: KeyboardEvent, editor: LexicalEditor): void {

const {keyCode, shiftKey, ctrlKey, metaKey, altKey} = event;

if (isMoveForward(keyCode, ctrlKey, shiftKey, altKey, metaKey)) {
if (isMoveForward(keyCode, ctrlKey, altKey, metaKey)) {
dispatchCommand(editor, KEY_ARROW_RIGHT_COMMAND, event);
} else if (isMoveToEnd(keyCode, ctrlKey, shiftKey, altKey, metaKey)) {
dispatchCommand(editor, MOVE_TO_END, event);
} else if (isMoveBackward(keyCode, ctrlKey, shiftKey, altKey, metaKey)) {
} else if (isMoveBackward(keyCode, ctrlKey, altKey, metaKey)) {
dispatchCommand(editor, KEY_ARROW_LEFT_COMMAND, event);
} else if (isMoveToStart(keyCode, ctrlKey, shiftKey, altKey, metaKey)) {
dispatchCommand(editor, MOVE_TO_START, event);
} else if (isMoveUp(keyCode, ctrlKey, shiftKey, altKey, metaKey)) {
} else if (isMoveUp(keyCode, ctrlKey, metaKey)) {
dispatchCommand(editor, KEY_ARROW_UP_COMMAND, event);
} else if (isMoveDown(keyCode, ctrlKey, shiftKey, altKey, metaKey)) {
} else if (isMoveDown(keyCode, ctrlKey, metaKey)) {
dispatchCommand(editor, KEY_ARROW_DOWN_COMMAND, event);
} else if (isLineBreak(keyCode, shiftKey)) {
isInsertLineBreak = true;
Expand Down
7 changes: 0 additions & 7 deletions packages/lexical/src/LexicalUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ export function createUID(): string {
}

export function $updateSelectedTextFromDOM(
editor: LexicalEditor,
isCompositionEnd: boolean,
data?: string,
): void {
Expand Down Expand Up @@ -882,7 +881,6 @@ function isArrowDown(keyCode: number): boolean {
export function isMoveBackward(
keyCode: number,
ctrlKey: boolean,
shiftKey: boolean,
altKey: boolean,
metaKey: boolean,
): boolean {
Expand All @@ -902,7 +900,6 @@ export function isMoveToStart(
export function isMoveForward(
keyCode: number,
ctrlKey: boolean,
shiftKey: boolean,
altKey: boolean,
metaKey: boolean,
): boolean {
Expand All @@ -922,8 +919,6 @@ export function isMoveToEnd(
export function isMoveUp(
keyCode: number,
ctrlKey: boolean,
shiftKey: boolean,
altKey: boolean,
metaKey: boolean,
): boolean {
return isArrowUp(keyCode) && !ctrlKey && !metaKey;
Expand All @@ -932,8 +927,6 @@ export function isMoveUp(
export function isMoveDown(
keyCode: number,
ctrlKey: boolean,
shiftKey: boolean,
altKey: boolean,
metaKey: boolean,
): boolean {
return isArrowDown(keyCode) && !ctrlKey && !metaKey;
Expand Down