[lexical-playground] Bug Fix: capitalize shortcut not working in macos fix (#7508)

This commit is contained in:
Harshkumar Metkel
2025-05-09 20:27:33 +05:30
committed by GitHub
parent 5642c7bbd0
commit 635797df5b
3 changed files with 14 additions and 14 deletions

View File

@ -280,26 +280,26 @@ export async function toggleInsertCodeBlock(page) {
} }
export async function toggleLowercase(page) { export async function toggleLowercase(page) {
await keyDownCtrlOrMeta(page); await page.keyboard.down('Control');
await page.keyboard.down('Shift'); await page.keyboard.down('Shift');
await page.keyboard.press('1'); await page.keyboard.press('1');
await keyUpCtrlOrMeta(page); await page.keyboard.up('Control');
await page.keyboard.up('Shift'); await page.keyboard.up('Shift');
} }
export async function toggleUppercase(page) { export async function toggleUppercase(page) {
await keyDownCtrlOrMeta(page); await page.keyboard.down('Control');
await page.keyboard.down('Shift'); await page.keyboard.down('Shift');
await page.keyboard.press('2'); await page.keyboard.press('2');
await keyUpCtrlOrMeta(page); await page.keyboard.up('Control');
await page.keyboard.up('Shift'); await page.keyboard.up('Shift');
} }
export async function toggleCapitalize(page) { export async function toggleCapitalize(page) {
await keyDownCtrlOrMeta(page); await page.keyboard.down('Control');
await page.keyboard.down('Shift'); await page.keyboard.down('Shift');
await page.keyboard.press('3'); await page.keyboard.press('3');
await keyUpCtrlOrMeta(page); await page.keyboard.up('Control');
await page.keyboard.up('Shift'); await page.keyboard.up('Shift');
} }

View File

@ -779,13 +779,13 @@ i.page-break,
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
border: 0; border: 0;
max-width: 250px; max-width: 264px;
min-width: 100px; min-width: 100px;
} }
.dropdown .item.wide { .dropdown .item.wide {
align-items: center; align-items: center;
width: 248px; width: 260px;
} }
.dropdown .item.wide .icon-text-container { .dropdown .item.wide .icon-text-container {

View File

@ -29,9 +29,9 @@ export const SHORTCUTS = Object.freeze({
DECREASE_FONT_SIZE: IS_APPLE ? '⌘+Shift+,' : 'Ctrl+Shift+,', DECREASE_FONT_SIZE: IS_APPLE ? '⌘+Shift+,' : 'Ctrl+Shift+,',
INSERT_CODE_BLOCK: IS_APPLE ? '⌘+Shift+C' : 'Ctrl+Shift+C', INSERT_CODE_BLOCK: IS_APPLE ? '⌘+Shift+C' : 'Ctrl+Shift+C',
STRIKETHROUGH: IS_APPLE ? '⌘+Shift+S' : 'Ctrl+Shift+S', STRIKETHROUGH: IS_APPLE ? '⌘+Shift+S' : 'Ctrl+Shift+S',
LOWERCASE: IS_APPLE ? '+Shift+1' : 'Ctrl+Shift+1', LOWERCASE: IS_APPLE ? '+Shift+1' : 'Ctrl+Shift+1',
UPPERCASE: IS_APPLE ? '+Shift+2' : 'Ctrl+Shift+2', UPPERCASE: IS_APPLE ? '+Shift+2' : 'Ctrl+Shift+2',
CAPITALIZE: IS_APPLE ? '+Shift+3' : 'Ctrl+Shift+3', CAPITALIZE: IS_APPLE ? '+Shift+3' : 'Ctrl+Shift+3',
CENTER_ALIGN: IS_APPLE ? '⌘+Shift+E' : 'Ctrl+Shift+E', CENTER_ALIGN: IS_APPLE ? '⌘+Shift+E' : 'Ctrl+Shift+E',
JUSTIFY_ALIGN: IS_APPLE ? '⌘+Shift+J' : 'Ctrl+Shift+J', JUSTIFY_ALIGN: IS_APPLE ? '⌘+Shift+J' : 'Ctrl+Shift+J',
LEFT_ALIGN: IS_APPLE ? '⌘+Shift+L' : 'Ctrl+Shift+L', LEFT_ALIGN: IS_APPLE ? '⌘+Shift+L' : 'Ctrl+Shift+L',
@ -116,7 +116,7 @@ export function isLowercase(event: KeyboardEvent): boolean {
const {code} = event; const {code} = event;
return ( return (
(code === 'Numpad1' || code === 'Digit1') && (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; const {code} = event;
return ( return (
(code === 'Numpad2' || code === 'Digit2') && (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; const {code} = event;
return ( return (
(code === 'Numpad3' || code === 'Digit3') && (code === 'Numpad3' || code === 'Digit3') &&
isModifierMatch(event, {...CONTROL_OR_META, shiftKey: true}) isModifierMatch(event, {ctrlKey: true, shiftKey: true})
); );
} }