From 2974fb0f4e3e727a88d20c6ac3b105af01727047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Wed, 28 Apr 2021 13:06:18 +0200 Subject: [PATCH] :bug: Fix page always visible when selecting it in sitemap --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c95b5e2ce..515d3505f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,6 +33,7 @@ - Fix problem displaying team statistics [#859](https://github.com/penpot/penpot/issues/859) - Fix problems with text editor selection [Taiga #1546](https://tree.taiga.io/project/penpot/issue/1546) - Fix problem when opening the context menu in dashboard at the bottom [#856](https://github.com/penpot/penpot/issues/856) +- Fix visibility of pages in sitemap when changing page [Taiga #1618](https://tree.taiga.io/project/penpot/issue/1618) - Fix visual problem with group invite [Taiga #1290](https://tree.taiga.io/project/penpot/issue/1290) - Fix issues with promote owner panel [Taiga #763](https://tree.taiga.io/project/penpot/issue/763) - Allow use library colors when defining gradients [Taiga #1614](https://tree.taiga.io/project/penpot/issue/1614) diff --git a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs index c35ff9530..eb430cbf2 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs @@ -102,6 +102,13 @@ :index index :name (:name page)})] + (mf/use-effect + (mf/deps selected?) + (fn [] + (when selected? + (let [node (mf/ref-val dref)] + (.scrollIntoViewIfNeeded ^js node))))) + (mf/use-layout-effect (mf/deps (:edition @local)) (fn []