Explorar o código

Fix #2075 - Pinch zooming while typing text breaks the UI on Chrome Mac OS X (#2076)

Pedro Baracho %!s(int64=4) %!d(string=hai) anos
pai
achega
e34cf3aee3
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/element/textWysiwyg.tsx

+ 5 - 1
src/element/textWysiwyg.tsx

@@ -130,6 +130,7 @@ export const textWysiwyg = ({
   };
 
   const stopEvent = (event: Event) => {
+    event.preventDefault();
     event.stopPropagation();
   };
 
@@ -198,7 +199,10 @@ export const textWysiwyg = ({
   //  device keyboard is opened.
   window.addEventListener("resize", updateWysiwygStyle);
   window.addEventListener("pointerdown", onPointerDown);
-  window.addEventListener("wheel", stopEvent, true);
+  window.addEventListener("wheel", stopEvent, {
+    passive: false,
+    capture: true,
+  });
   document.body.appendChild(editable);
   editable.focus();
   editable.select();