mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 23:07:27 +02:00
✨ Add open components, and scroll into view to show main component acction
This commit is contained in:
parent
c69d7f50a3
commit
6dae420254
6 changed files with 148 additions and 85 deletions
|
@ -354,6 +354,12 @@
|
|||
([element scroll-top]
|
||||
(.scrollIntoView ^js element scroll-top)))
|
||||
|
||||
(defn scroll-into-view-if-needed!
|
||||
([element]
|
||||
(.scrollIntoViewIfNeeded ^js element false))
|
||||
([element scroll-top]
|
||||
(.scrollIntoViewIfNeeded ^js element scroll-top)))
|
||||
|
||||
(defn is-in-viewport?
|
||||
[element]
|
||||
(let [rect (.getBoundingClientRect element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue