0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

🐛 Fix comments section not scrolling

This commit is contained in:
Alejandro Alonso 2022-10-14 10:30:11 +02:00 committed by Pablo Alba
parent 563a6da83c
commit 41f5fb9621
4 changed files with 7 additions and 10 deletions

View file

@ -57,7 +57,7 @@
- Fix artboard border radius [Taiga #4291](https://tree.taiga.io/project/penpot/issue/4291)
- Fix copied & pasted layer is not visible [Taiga #4283](https://tree.taiga.io/project/penpot/issue/4283)
- Fix notification to newsletter is shown in all cases [Taiga #4367](https://tree.taiga.io/project/penpot/issue/4367)
- Fix comments section is not scrolling by mouse wheel [Taiga #4305](https://tree.taiga.io/project/penpot/issue/4305)
## 1.15.4-beta
### :bug: Bugs fixed

View file

@ -96,7 +96,6 @@
;; REFS
viewport-ref (mf/use-ref nil)
overlays-ref (mf/use-ref nil)
;; VARS
disable-paste (mf/use-var false)
@ -184,7 +183,7 @@
disabled-guides? (or drawing-tool transform)]
(hooks/setup-dom-events viewport-ref overlays-ref zoom disable-paste in-viewport?)
(hooks/setup-dom-events viewport-ref zoom disable-paste in-viewport?)
(hooks/setup-viewport-size viewport-ref)
(hooks/setup-cursor cursor alt? mod? space? panning drawing-tool drawing-path? node-editing?)
(hooks/setup-keyboard alt? mod? space?)
@ -194,7 +193,7 @@
(hooks/setup-active-frames base-objects hover-ids selected active-frames zoom transform vbox)
[:div.viewport
[:div.viewport-overlays {:ref overlays-ref}
[:div.viewport-overlays
;; The behaviour inside a foreign object is a bit different that in plain HTML so we wrap
;; inside a foreign object "dummy" so this awkward behaviour is take into account
[:svg {:style {:top 0 :left 0 :position "fixed" :width "100%" :height "100%" :opacity 0}}

View file

@ -359,18 +359,16 @@
pt (utils/translate-point-to-viewport viewport zoom raw-pt)]
(rx/push! move-stream pt)))))
(defn on-mouse-wheel [viewport-ref overlays-ref zoom]
(defn on-mouse-wheel [viewport-ref zoom]
(mf/use-callback
(mf/deps zoom)
(fn [event]
(let [viewport (mf/ref-val viewport-ref)
overlays (mf/ref-val overlays-ref)
event (.getBrowserEvent ^js event)
target (dom/get-target event)
mod? (kbd/mod? event)]
(when (or (dom/is-child? viewport target)
(dom/is-child? overlays target))
(when (dom/is-child? viewport target)
(dom/prevent-default event)
(dom/stop-propagation event)
(let [pt (->> (dom/get-client-position event)

View file

@ -31,11 +31,11 @@
[rumext.v2 :as mf])
(:import goog.events.EventType))
(defn setup-dom-events [viewport-ref overlays-ref zoom disable-paste in-viewport?]
(defn setup-dom-events [viewport-ref zoom disable-paste in-viewport?]
(let [on-key-down (actions/on-key-down)
on-key-up (actions/on-key-up)
on-mouse-move (actions/on-mouse-move viewport-ref zoom)
on-mouse-wheel (actions/on-mouse-wheel viewport-ref overlays-ref zoom)
on-mouse-wheel (actions/on-mouse-wheel viewport-ref zoom)
on-paste (actions/on-paste disable-paste in-viewport?)]
(mf/use-layout-effect
(mf/deps on-key-down on-key-up on-mouse-move on-mouse-wheel on-paste)