0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 13:29:14 -05:00

Merge pull request #3455 from penpot/azazeln28-fix-layers-scroll-breaking-new-css-system

Fix layers scroll breaking new css system
This commit is contained in:
Eva Marco 2023-07-31 08:03:34 +02:00 committed by GitHub
commit cc682a382f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -173,7 +173,7 @@
;; NOTE: Neither get-parent-at nor get-parent-with-selector
;; work if the component template changes, so we need to
;; seek for an alternate solution. Maybe use-context?
scroll-node (dom/get-parent-with-selector node ".tool-window-content")
scroll-node (dom/get-parent-with-data node "scrollContainer")
parent-node (dom/get-parent-at node 2)
subid

View file

@ -506,7 +506,8 @@
filter-component)
(if (some? filtered-objects)
[:*
[:div {:class (if new-css-system
[:div {:data-scroll-container true
:class (if new-css-system
(dom/classnames (css :tool-window-content) true)
(dom/classnames :tool-window-content true))
:ref on-render-container :key "filters"}
@ -517,6 +518,7 @@
:key "lazy-load"
:style {:min-height 16}}]]
[:div {:on-scroll on-scroll
:data-scroll-container true
:class (if new-css-system
(dom/classnames (css :tool-window-content) true)
(dom/classnames :tool-window-content true))
@ -526,6 +528,7 @@
:filtered? true
:parent-size size-parent}]]]
[:div {:on-scroll on-scroll
:data-scroll-container true
:class (if new-css-system
(dom/classnames (css :tool-window-content) true)
(dom/classnames :tool-window-content true))

View file

@ -151,6 +151,13 @@
current
(recur (.-parentElement current) (dec current-count))))))
(defn get-parent-with-data
[^js node name]
(loop [current node]
(if (or (nil? current) (obj/in? (.-dataset current) name))
current
(recur (.-parentElement current)))))
(defn get-parent-with-selector
[^js node selector]
(loop [current node]