Fixed Chromium issues - made listner non-passive

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2020-12-19 13:30:56 +01:00
parent b9f480a825
commit 2c5f3f31b1
1 changed files with 9 additions and 1 deletions

View File

@ -52,6 +52,14 @@ export default class ImageView extends React.Component {
}; };
} }
componentDidMount() {
this.focusLock.addEventListener('wheel', this.onWheel, { passive: false });
}
componentWillUnmount() {
this.focusLock.removeEventListener('wheel', this.onWheel);
}
onKeyDown = (ev) => { onKeyDown = (ev) => {
if (ev.key === Key.ESCAPE) { if (ev.key === Key.ESCAPE) {
ev.stopPropagation(); ev.stopPropagation();
@ -216,10 +224,10 @@ export default class ImageView extends React.Component {
returnFocus={true} returnFocus={true}
lockProps={{ lockProps={{
onKeyDown: this.onKeyDown, onKeyDown: this.onKeyDown,
onWheel: this.onWheel,
role: "dialog", role: "dialog",
}} }}
className="mx_ImageView" className="mx_ImageView"
ref={ref => this.focusLock = ref}
> >
<div className="mx_ImageView_content"> <div className="mx_ImageView_content">
<div className="mx_ImageView_panel"> <div className="mx_ImageView_panel">