From 278257c1d1e31f4501f7f26e6742e1e5cb8a491a Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Tue, 9 Jul 2019 12:19:46 +0530 Subject: [PATCH] fix: ELECTRON-1037 (Disable context menu for notification windows) (#708) * ELECTRON-1037 - Disable context menu for notification windows * ELECTRON-1037 - Fix typo --- src/renderer/components/notification-comp.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/notification-comp.tsx b/src/renderer/components/notification-comp.tsx index cda12380..1417ec10 100644 --- a/src/renderer/components/notification-comp.tsx +++ b/src/renderer/components/notification-comp.tsx @@ -23,6 +23,7 @@ export default class NotificationComp extends React.Component<{}, IState> { private readonly eventHandlers = { onClose: (winKey) => (_event: mouseEventButton) => this.close(winKey), onClick: (data) => (_event: mouseEventButton) => this.click(data), + onContextMenu: (event) => this.contextMenu(event), }; constructor(props) { @@ -59,7 +60,7 @@ export default class NotificationComp extends React.Component<{}, IState> { const bgColor = { backgroundColor: colorHex || '#ffffff' }; return ( -
+
symphony logo
@@ -99,6 +100,15 @@ export default class NotificationComp extends React.Component<{}, IState> { ipcRenderer.send('close-notification', id); } + /** + * Disable context menu + * + * @param event + */ + private contextMenu(event) { + event.preventDefault(); + } + /** * Sets the About app state *