mirror of
https://github.com/facebook/lexical.git
synced 2025-05-17 15:18:47 +08:00
[lexical-playground] Bug Fix: capitalize shortcut not working in macos fix (#7508)
This commit is contained in:

committed by
GitHub

parent
5642c7bbd0
commit
635797df5b
@ -280,26 +280,26 @@ export async function toggleInsertCodeBlock(page) {
|
||||
}
|
||||
|
||||
export async function toggleLowercase(page) {
|
||||
await keyDownCtrlOrMeta(page);
|
||||
await page.keyboard.down('Control');
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('1');
|
||||
await keyUpCtrlOrMeta(page);
|
||||
await page.keyboard.up('Control');
|
||||
await page.keyboard.up('Shift');
|
||||
}
|
||||
|
||||
export async function toggleUppercase(page) {
|
||||
await keyDownCtrlOrMeta(page);
|
||||
await page.keyboard.down('Control');
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('2');
|
||||
await keyUpCtrlOrMeta(page);
|
||||
await page.keyboard.up('Control');
|
||||
await page.keyboard.up('Shift');
|
||||
}
|
||||
|
||||
export async function toggleCapitalize(page) {
|
||||
await keyDownCtrlOrMeta(page);
|
||||
await page.keyboard.down('Control');
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('3');
|
||||
await keyUpCtrlOrMeta(page);
|
||||
await page.keyboard.up('Control');
|
||||
await page.keyboard.up('Shift');
|
||||
}
|
||||
|
||||
|
@ -779,13 +779,13 @@ i.page-break,
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
max-width: 250px;
|
||||
max-width: 264px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.dropdown .item.wide {
|
||||
align-items: center;
|
||||
width: 248px;
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.dropdown .item.wide .icon-text-container {
|
||||
|
@ -29,9 +29,9 @@ export const SHORTCUTS = Object.freeze({
|
||||
DECREASE_FONT_SIZE: IS_APPLE ? '⌘+Shift+,' : 'Ctrl+Shift+,',
|
||||
INSERT_CODE_BLOCK: IS_APPLE ? '⌘+Shift+C' : 'Ctrl+Shift+C',
|
||||
STRIKETHROUGH: IS_APPLE ? '⌘+Shift+S' : 'Ctrl+Shift+S',
|
||||
LOWERCASE: IS_APPLE ? '⌘+Shift+1' : 'Ctrl+Shift+1',
|
||||
UPPERCASE: IS_APPLE ? '⌘+Shift+2' : 'Ctrl+Shift+2',
|
||||
CAPITALIZE: IS_APPLE ? '⌘+Shift+3' : 'Ctrl+Shift+3',
|
||||
LOWERCASE: IS_APPLE ? '⌃+Shift+1' : 'Ctrl+Shift+1',
|
||||
UPPERCASE: IS_APPLE ? '⌃+Shift+2' : 'Ctrl+Shift+2',
|
||||
CAPITALIZE: IS_APPLE ? '⌃+Shift+3' : 'Ctrl+Shift+3',
|
||||
CENTER_ALIGN: IS_APPLE ? '⌘+Shift+E' : 'Ctrl+Shift+E',
|
||||
JUSTIFY_ALIGN: IS_APPLE ? '⌘+Shift+J' : 'Ctrl+Shift+J',
|
||||
LEFT_ALIGN: IS_APPLE ? '⌘+Shift+L' : 'Ctrl+Shift+L',
|
||||
@ -116,7 +116,7 @@ export function isLowercase(event: KeyboardEvent): boolean {
|
||||
const {code} = event;
|
||||
return (
|
||||
(code === 'Numpad1' || code === 'Digit1') &&
|
||||
isModifierMatch(event, {...CONTROL_OR_META, shiftKey: true})
|
||||
isModifierMatch(event, {ctrlKey: true, shiftKey: true})
|
||||
);
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ export function isUppercase(event: KeyboardEvent): boolean {
|
||||
const {code} = event;
|
||||
return (
|
||||
(code === 'Numpad2' || code === 'Digit2') &&
|
||||
isModifierMatch(event, {...CONTROL_OR_META, shiftKey: true})
|
||||
isModifierMatch(event, {ctrlKey: true, shiftKey: true})
|
||||
);
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ export function isCapitalize(event: KeyboardEvent): boolean {
|
||||
const {code} = event;
|
||||
return (
|
||||
(code === 'Numpad3' || code === 'Digit3') &&
|
||||
isModifierMatch(event, {...CONTROL_OR_META, shiftKey: true})
|
||||
isModifierMatch(event, {ctrlKey: true, shiftKey: true})
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user