From 0d21e8aad248bac6bd9ab107665ab3358ccdde5b Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Sat, 30 Sep 2023 22:39:09 +0100 Subject: [PATCH] [fix] Screen bounds offset after editing text (#1976) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes an issue where the screen bounds could be wrong after editing text on iOS / mobile. ### Change Type - [x] `patch` — Bug fix ### Test Plan 1. On iOS, create a text shape at the bottom of the screen. 2. Edit the text shape. 3. Stop editing. 4. Drag a selection box to confirm that the page bounds is still correct. --- .../tldraw/src/lib/tools/SelectTool/children/EditingShape.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/tldraw/src/lib/tools/SelectTool/children/EditingShape.ts b/packages/tldraw/src/lib/tools/SelectTool/children/EditingShape.ts index 59d788d77..06151ad60 100644 --- a/packages/tldraw/src/lib/tools/SelectTool/children/EditingShape.ts +++ b/packages/tldraw/src/lib/tools/SelectTool/children/EditingShape.ts @@ -31,6 +31,10 @@ export class EditingShape extends StateNode { // Check for changes on editing end util.onEditEnd?.(shape) + + setTimeout(() => { + this.editor.updateViewportScreenBounds() + }, 500) } override onPointerMove: TLEventHandlers['onPointerMove'] = (info) => {