mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 03:32:36 +02: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 {
|
&.selected {
|
||||||
|
background-color: $colro-gray-60;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
fill: $color-primary;
|
fill: $color-primary;
|
||||||
|
|
|
@ -185,6 +185,12 @@
|
||||||
:index index
|
:index index
|
||||||
:name (:name item)})]
|
: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
|
[:li {:on-context-menu on-context-menu
|
||||||
:ref dref
|
:ref dref
|
||||||
:class (dom/classnames
|
:class (dom/classnames
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue