0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

Scroll selected layer into view

This commit is contained in:
alonso.torres 2020-10-02 13:22:04 +02:00 committed by Andrey Antukh
parent 6d9155032f
commit 59ae0b0f55
2 changed files with 7 additions and 0 deletions

View file

@ -64,6 +64,7 @@
}
&.selected {
background-color: $colro-gray-60;
svg {
fill: $color-primary;

View file

@ -185,6 +185,12 @@
:index index
:name (:name item)})]
(mf/use-effect
(mf/deps selected?)
(fn []
(when selected?
(.scrollIntoView (mf/ref-val dref) false))))
[:li {:on-context-menu on-context-menu
:ref dref
:class (dom/classnames