From 670e2c437543a1577f49513c4348b66b1ed51437 Mon Sep 17 00:00:00 2001 From: Choi-Jinwoo Date: Fri, 6 Aug 2021 12:53:34 +0900 Subject: [PATCH] =?UTF-8?q?add:=20=EC=9E=90=EB=8F=99=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A1=A4=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/category-expenditure/index.css | 1 + frontend/src/views/category-expenditure/index.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/category-expenditure/index.css b/frontend/src/views/category-expenditure/index.css index 2871ccd..6975dbd 100644 --- a/frontend/src/views/category-expenditure/index.css +++ b/frontend/src/views/category-expenditure/index.css @@ -12,6 +12,7 @@ border-radius: 10px; padding: 32px; } + .category-expenditure__title { margin-bottom: 32px; color: var(--title-active); diff --git a/frontend/src/views/category-expenditure/index.ts b/frontend/src/views/category-expenditure/index.ts index 7155131..e517bb2 100644 --- a/frontend/src/views/category-expenditure/index.ts +++ b/frontend/src/views/category-expenditure/index.ts @@ -133,7 +133,16 @@ class CategoryExpenditureView extends View { } show (): void { - $('.category-expenditure')?.classList.remove('disappear'); + const $categoryExpenditure = $('.category-expenditure'); + if ($categoryExpenditure !== null) { + $categoryExpenditure.classList.remove('disappear'); + const { top } = $categoryExpenditure.getBoundingClientRect(); + + window.scrollTo({ + top, + behavior: 'smooth' + }); + } } protected render (): void {