mirror of
https://github.com/facebook/lexical.git
synced 2025-05-17 06:59:17 +08:00
[lexical] Chore: Revert Enter command to use inexact matching (#7479)
This commit is contained in:
@ -926,11 +926,20 @@ export function isUnderline(event: KeyboardEventModifiers): boolean {
|
||||
}
|
||||
|
||||
export function isParagraph(event: KeyboardEventModifiers): boolean {
|
||||
return isExactShortcutMatch(event, 'Enter', {});
|
||||
return isExactShortcutMatch(event, 'Enter', {
|
||||
altKey: 'any',
|
||||
ctrlKey: 'any',
|
||||
metaKey: 'any',
|
||||
});
|
||||
}
|
||||
|
||||
export function isLineBreak(event: KeyboardEventModifiers): boolean {
|
||||
return isExactShortcutMatch(event, 'Enter', {shiftKey: true});
|
||||
return isExactShortcutMatch(event, 'Enter', {
|
||||
altKey: 'any',
|
||||
ctrlKey: 'any',
|
||||
metaKey: 'any',
|
||||
shiftKey: true,
|
||||
});
|
||||
}
|
||||
|
||||
// Inserts a new line after the selection
|
||||
@ -1045,10 +1054,6 @@ export function controlOrMeta(metaKey: boolean, ctrlKey: boolean): boolean {
|
||||
return ctrlKey;
|
||||
}
|
||||
|
||||
export function isReturn(event: KeyboardEventModifiers): boolean {
|
||||
return event.key === 'Enter';
|
||||
}
|
||||
|
||||
export function isBackspace(event: KeyboardEventModifiers): boolean {
|
||||
return event.key === 'Backspace';
|
||||
}
|
||||
|
Reference in New Issue
Block a user