diff --git a/src/components/views/rooms/RoomTile2.tsx b/src/components/views/rooms/RoomTile2.tsx index 7dbe9f1f10..6f686dbac3 100644 --- a/src/components/views/rooms/RoomTile2.tsx +++ b/src/components/views/rooms/RoomTile2.tsx @@ -160,9 +160,11 @@ export default class RoomTile2 extends React.Component { this.setState({notificationsMenuPosition: target.getBoundingClientRect()}); }; - private onCloseNotificationsMenu = (ev: InputEvent) => { - ev.preventDefault(); - ev.stopPropagation(); + private onCloseNotificationsMenu = (ev?: InputEvent) => { + if (ev) { + ev.preventDefault(); + ev.stopPropagation(); + } this.setState({notificationsMenuPosition: null}); }; @@ -187,9 +189,11 @@ export default class RoomTile2 extends React.Component { }); }; - private onCloseGeneralMenu = (ev: InputEvent) => { - ev.preventDefault(); - ev.stopPropagation(); + private onCloseGeneralMenu = (ev?: InputEvent) => { + if (ev) { + ev.preventDefault(); + ev.stopPropagation(); + } this.setState({generalMenuPosition: null}); };