mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
✨ Scroll selected layer into view
This commit is contained in:
parent
6d9155032f
commit
59ae0b0f55
2 changed files with 7 additions and 0 deletions
|
@ -64,6 +64,7 @@
|
|||
}
|
||||
|
||||
&.selected {
|
||||
background-color: $colro-gray-60;
|
||||
|
||||
svg {
|
||||
fill: $color-primary;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue