fix: permanent zoom mode (#3931)

This commit is contained in:
David Luzar 2021-08-23 22:47:29 +02:00 committed by GitHub
parent 850d8eb47e
commit f0f13ed694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -831,6 +831,7 @@ class App extends React.Component<AppProps, AppState> {
});
private removeEventListeners() {
document.removeEventListener(EVENT.POINTER_UP, this.removePointer);
document.removeEventListener(EVENT.COPY, this.onCopy);
document.removeEventListener(EVENT.PASTE, this.pasteFromClipboard);
document.removeEventListener(EVENT.CUT, this.onCut);
@ -872,6 +873,7 @@ class App extends React.Component<AppProps, AppState> {
private addEventListeners() {
this.removeEventListeners();
document.addEventListener(EVENT.POINTER_UP, this.removePointer); // #3553
document.addEventListener(EVENT.COPY, this.onCopy);
if (this.props.handleKeyboardGlobally) {
document.addEventListener(EVENT.KEYDOWN, this.onKeyDown, false);
@ -1328,7 +1330,7 @@ class App extends React.Component<AppProps, AppState> {
this.setState(obj);
};
removePointer = (event: React.PointerEvent<HTMLElement>) => {
removePointer = (event: React.PointerEvent<HTMLElement> | PointerEvent) => {
// remove touch handler for context menu on touch devices
if (event.pointerType === "touch" && touchTimeout) {
clearTimeout(touchTimeout);