You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Fixed Chromium issues - made listner non-passive
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user