diff --git a/CHANGES.md b/CHANGES.md index 4b7f3dec4..3014cbb73 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ - Fix style for team invite in deutsch [Taiga #4614](https://tree.taiga.io/project/penpot/issue/4614) - Fix problem with text edition in Safari [Taiga #4046](https://tree.taiga.io/project/penpot/issue/4046) - Fix show outline with rounded corners on rects [Taiga #4053](https://tree.taiga.io/project/penpot/issue/4053) +- Fix bad element positioning on interaction with fixed scroll [Github #2660](https://github.com/penpot/penpot/issues/2660) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/refs.cljs b/frontend/src/app/main/refs.cljs index df141a2d3..5cb009e68 100644 --- a/frontend/src/app/main/refs.cljs +++ b/frontend/src/app/main/refs.cljs @@ -484,5 +484,18 @@ ids))) st/state =)) + +(defn get-viewer-objects + ([] + (let [route (deref route) + page-id (:page-id (:query-params route))] + (get-viewer-objects page-id))) + ([page-id] + (l/derived + (fn [state] + (let [objects (wsh/lookup-viewer-objects state page-id)] + objects)) + st/state =))) + (def colorpicker (l/derived :colorpicker st/state)) diff --git a/frontend/src/app/main/ui/viewer/shapes.cljs b/frontend/src/app/main/ui/viewer/shapes.cljs index e43ff5780..c364d38c1 100644 --- a/frontend/src/app/main/ui/viewer/shapes.cljs +++ b/frontend/src/app/main/ui/viewer/shapes.cljs @@ -58,7 +58,8 @@ :open-overlay (let [dest-frame-id (:destination interaction) - dest-frame (get objects dest-frame-id) + viewer-objects (deref (refs/get-viewer-objects)) + dest-frame (get viewer-objects dest-frame-id) relative-to-id (if (= :manual (:overlay-pos-type interaction)) (:id shape) ;; manual interactions are allways from "self" (:position-relative-to interaction))