SDA-4352 Devtools shortcut fix - DraftJS is considering Ctrl + I as italic (#1964)

This commit is contained in:
Salah Benmoussati 2023-10-03 21:09:15 +02:00 committed by GitHub
parent c6182a902e
commit 61752932b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,9 +462,16 @@ export class WindowHandler {
windowHandler.switchClient(clientSwitchType);
}, SHORTCUT_KEY_THROTTLE);
this.mainWebContents.on('before-input-event', (event, input) => {
const windowsDevTools =
input.control && input.shift && input.key.toLowerCase() === 'i';
const macDevTools =
input.meta && input.alt && input.key.toLowerCase() === 'i';
if (input.control && input.shift && input.key.toLowerCase() === 'd') {
event.preventDefault();
throttledExportLogs();
} else if (windowsDevTools || macDevTools) {
event.preventDefault();
this.mainWebContents?.toggleDevTools();
}
const isCtrlOrMeta = isMac ? input.meta : input.control;
if (this.url && this.url.startsWith('https://corporate.symphony.com')) {