mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 12:42:13 +02:00
🎉 Add preserve scroll option
This commit is contained in:
parent
3d59d31b0a
commit
f913816d87
14 changed files with 94 additions and 12 deletions
|
@ -44,7 +44,12 @@
|
|||
(case (:action-type interaction)
|
||||
:navigate
|
||||
(when-let [frame-id (:destination interaction)]
|
||||
(st/emit! (dv/go-to-frame frame-id)))
|
||||
(let [viewer-section (dom/get-element "viewer-section")
|
||||
scroll (if (:preserve-scroll interaction)
|
||||
(dom/get-scroll-pos viewer-section)
|
||||
0)]
|
||||
(st/emit! (dv/set-nav-scroll scroll)
|
||||
(dv/go-to-frame frame-id))))
|
||||
|
||||
:open-overlay
|
||||
(let [dest-frame-id (:destination interaction)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue