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

This commit is contained in:
Pedro Baracho 2020-08-25 02:38:03 -07:00 committed by GitHub
parent 960b640e89
commit e34cf3aee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();