From e5786b200ac27140db0b15878980bc7797193a90 Mon Sep 17 00:00:00 2001 From: martin <74269598+martabal@users.noreply.github.com> Date: Wed, 10 Jan 2024 04:52:12 +0100 Subject: [PATCH] fix(web): large description on detail-panel (#6305) --- web/src/lib/components/asset-viewer/detail-panel.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index 48faadcd07..7d149e2cf6 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -60,6 +60,7 @@ api.assetApi.getAssetById({ id: asset.id }).then((res) => { people = res.data?.people || []; textarea.value = res.data?.exifInfo?.description || ''; + autoGrowHeight(); }); } } @@ -112,10 +113,9 @@ showEditFaces = false; }; - const autoGrowHeight = (e: Event) => { - const target = e.target as HTMLTextAreaElement; - target.style.height = 'auto'; - target.style.height = `${target.scrollHeight}px`; + const autoGrowHeight = () => { + textarea.style.height = 'auto'; + textarea.style.height = `${textarea.scrollHeight}px`; }; const handleFocusIn = () => {