From c20d9fc9d21c1e2c5b3efe6276426434f311767b Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 26 Mar 2024 11:16:15 +0000 Subject: [PATCH] fix document name overflow (#3263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the document name getting truncated as I forgot to update a measurement in the CSS. Also fixes an issue where if you had a long title which you then cleared, the input width wouldn't update until you entered your first character of the new name. ### Change Type - [x] `dotcom` — Changes the tldraw.com web app - [x] `bugfix` — Bug fix --- apps/dotcom/src/components/DocumentName/DocumentName.tsx | 2 +- apps/dotcom/styles/z-board.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dotcom/src/components/DocumentName/DocumentName.tsx b/apps/dotcom/src/components/DocumentName/DocumentName.tsx index 8a85b020e..0194c1790 100644 --- a/apps/dotcom/src/components/DocumentName/DocumentName.tsx +++ b/apps/dotcom/src/components/DocumentName/DocumentName.tsx @@ -276,7 +276,7 @@ const DocumentNameEditor = track(function DocumentNameEditor({ setState((prev) => ({ ...prev, isEditing: false })) }, [setState]) - const name = state.name || documentSettings.name || defaultDocumentName + const name = state.name ?? (documentSettings.name || defaultDocumentName) return (
diff --git a/apps/dotcom/styles/z-board.css b/apps/dotcom/styles/z-board.css index facad3d2a..9d0f31ae2 100644 --- a/apps/dotcom/styles/z-board.css +++ b/apps/dotcom/styles/z-board.css @@ -339,7 +339,7 @@ .tlui-document-name__input__wrapper { position: relative; - max-width: calc(100% - 40px); + max-width: calc(100% - 36px); display: flex; flex: auto; }