Fixed Chromium issues - made listner non-passive

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2020-12-19 13:30:56 +01:00
parent b9f480a825
commit 2c5f3f31b1

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) => {
if (ev.key === Key.ESCAPE) {
ev.stopPropagation();
@ -216,10 +224,10 @@ export default class ImageView extends React.Component {
returnFocus={true}
lockProps={{
onKeyDown: this.onKeyDown,
onWheel: this.onWheel,
role: "dialog",
}}
className="mx_ImageView"
ref={ref => this.focusLock = ref}
>
<div className="mx_ImageView_content">
<div className="mx_ImageView_panel">