mirror of https://github.com/vector-im/riot-web
Wrap event stoppage in null checks
Some of the code paths (particularly onFinished) do not have events, but the code paths we care about to prevent the room selection do have events - we can stop those without stopping further menus.pull/21833/head
parent
aa702514ce
commit
547690374e
|
@ -160,9 +160,11 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
this.setState({notificationsMenuPosition: target.getBoundingClientRect()});
|
this.setState({notificationsMenuPosition: target.getBoundingClientRect()});
|
||||||
};
|
};
|
||||||
|
|
||||||
private onCloseNotificationsMenu = (ev: InputEvent) => {
|
private onCloseNotificationsMenu = (ev?: InputEvent) => {
|
||||||
ev.preventDefault();
|
if (ev) {
|
||||||
ev.stopPropagation();
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
|
}
|
||||||
this.setState({notificationsMenuPosition: null});
|
this.setState({notificationsMenuPosition: null});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -187,9 +189,11 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
private onCloseGeneralMenu = (ev: InputEvent) => {
|
private onCloseGeneralMenu = (ev?: InputEvent) => {
|
||||||
ev.preventDefault();
|
if (ev) {
|
||||||
ev.stopPropagation();
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
|
}
|
||||||
this.setState({generalMenuPosition: null});
|
this.setState({generalMenuPosition: null});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue