diff --git a/src/components/App.tsx b/src/components/App.tsx index 1d0c9e2a..6814d273 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1916,7 +1916,10 @@ class App extends React.Component { }, this.state, ); - return [viewportX, viewportY]; + return [ + viewportX - this.state.offsetLeft, + viewportY - this.state.offsetTop, + ]; }, onChange: withBatchedUpdates((text) => { updateElement(text, text, false, !element.containerId); diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx index 51b9a160..46685c83 100644 --- a/src/element/textWysiwyg.tsx +++ b/src/element/textWysiwyg.tsx @@ -426,10 +426,10 @@ export const textWysiwyg = ({ if (isTextElement(updateElement) && updateElement.containerId) { if (editable.value) { mutateElement(updateElement, { - y, + y: y + appState.offsetTop, height: Number(editable.style.height.slice(0, -2)), width: Number(editable.style.width.slice(0, -2)), - x, + x: x + appState.offsetLeft, }); const boundTextElementId = getBoundTextElementId(container); if (!boundTextElementId || boundTextElementId !== element.id) {