diff --git a/CHANGELOG.md b/CHANGELOG.md index a58e52c40..c7e23715c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [client] Fixed an issue with the transcripts path input inside of the resource settings dialog in PR [1836](https://github.com/microsoft/BotFramework-Emulator/pull/1836) - [client] Implemented HTML app menu for Windows in PR [1893](https://github.com/microsoft/BotFramework-Emulator/pull/1893) - [client/main] Migrated from Bing Speech API to Cognitive Services Speech API in PR [1878](https://github.com/microsoft/BotFramework-Emulator/pull/1878) + - [client] Fixed issue with certain native browser functions (cut, copy, paste, etc.) firing twice in PR [1920](https://github.com/microsoft/BotFramework-Emulator/pull/1920) ## v4.5.2 - 2019 - 07 - 17 diff --git a/packages/app/client/src/utils/eventHandlers.spec.ts b/packages/app/client/src/utils/eventHandlers.spec.ts index 8134053b7..782de0bad 100644 --- a/packages/app/client/src/utils/eventHandlers.spec.ts +++ b/packages/app/client/src/utils/eventHandlers.spec.ts @@ -47,11 +47,6 @@ const { let mockLocalCommandsCalled = []; let mockRemoteCommandsCalled = []; const mockCurrentWebContents = { - undo: jest.fn(), - redo: jest.fn(), - cut: jest.fn(), - copy: jest.fn(), - paste: jest.fn(), setZoomLevel: jest.fn(), getZoomFactor: jest.fn(), setZoomFactor: jest.fn(), @@ -165,41 +160,6 @@ describe('#globalHandlers', () => { }); }); - it('should perform an undo when Ctrl+Z is pressed', async () => { - const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'z' }); - await globalHandlers(event); - - expect(mockCurrentWebContents.undo).toHaveBeenCalled(); - }); - - it('should perform a redo when Ctrl+Y is pressed', async () => { - const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'y' }); - await globalHandlers(event); - - expect(mockCurrentWebContents.redo).toHaveBeenCalled(); - }); - - it('should perform a cut when Ctrl+X is pressed', async () => { - const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'x' }); - await globalHandlers(event); - - expect(mockCurrentWebContents.cut).toHaveBeenCalled(); - }); - - it('should perform a copy when Ctrl+C is pressed', async () => { - const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'c' }); - await globalHandlers(event); - - expect(mockCurrentWebContents.copy).toHaveBeenCalled(); - }); - - it('should perform a paste when Ctrl+V is pressed', async () => { - const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'v' }); - await globalHandlers(event); - - expect(mockCurrentWebContents.paste).toHaveBeenCalled(); - }); - it('should reset the zoom level when Ctrl+0 is pressed', async () => { const event = new KeyboardEvent('keydown', { ctrlKey: true, key: '0' }); await globalHandlers(event); diff --git a/packages/app/client/src/utils/eventHandlers.ts b/packages/app/client/src/utils/eventHandlers.ts index 1a883b713..ec8447058 100644 --- a/packages/app/client/src/utils/eventHandlers.ts +++ b/packages/app/client/src/utils/eventHandlers.ts @@ -66,31 +66,6 @@ class EventHandlers { awaitable = EventHandlers.commandService.call(ShowBotCreationDialog); } - // Ctrl+Z - if (ctrlOrCmdPressed && key === 'z') { - remote.getCurrentWebContents().undo(); - } - - // Ctrl+Y - if (ctrlOrCmdPressed && key === 'y') { - remote.getCurrentWebContents().redo(); - } - - // Ctrl+X - if (ctrlOrCmdPressed && key === 'x') { - remote.getCurrentWebContents().cut(); - } - - // Ctrl+C - if (ctrlOrCmdPressed && key === 'c') { - remote.getCurrentWebContents().copy(); - } - - // Ctrl+V - if (ctrlOrCmdPressed && key === 'v') { - remote.getCurrentWebContents().paste(); - } - // Ctrl+0 if (ctrlOrCmdPressed && key === '0') { remote.getCurrentWebContents().setZoomLevel(0);