From e34cf3aee3348d8763308f2ae66e2425170d52b0 Mon Sep 17 00:00:00 2001 From: Pedro Baracho Date: Tue, 25 Aug 2020 02:38:03 -0700 Subject: [PATCH] Fix #2075 - Pinch zooming while typing text breaks the UI on Chrome Mac OS X (#2076) --- src/element/textWysiwyg.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx index 29427a9c..5743a69d 100644 --- a/src/element/textWysiwyg.tsx +++ b/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();