mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 09:08:31 -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:
commit
cc682a382f
3 changed files with 12 additions and 2 deletions
|
@ -173,7 +173,7 @@
|
||||||
;; NOTE: Neither get-parent-at nor get-parent-with-selector
|
;; NOTE: Neither get-parent-at nor get-parent-with-selector
|
||||||
;; work if the component template changes, so we need to
|
;; work if the component template changes, so we need to
|
||||||
;; seek for an alternate solution. Maybe use-context?
|
;; 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)
|
parent-node (dom/get-parent-at node 2)
|
||||||
|
|
||||||
subid
|
subid
|
||||||
|
|
|
@ -506,7 +506,8 @@
|
||||||
filter-component)
|
filter-component)
|
||||||
(if (some? filtered-objects)
|
(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 (css :tool-window-content) true)
|
||||||
(dom/classnames :tool-window-content true))
|
(dom/classnames :tool-window-content true))
|
||||||
:ref on-render-container :key "filters"}
|
:ref on-render-container :key "filters"}
|
||||||
|
@ -517,6 +518,7 @@
|
||||||
:key "lazy-load"
|
:key "lazy-load"
|
||||||
:style {:min-height 16}}]]
|
:style {:min-height 16}}]]
|
||||||
[:div {:on-scroll on-scroll
|
[:div {:on-scroll on-scroll
|
||||||
|
:data-scroll-container true
|
||||||
:class (if new-css-system
|
:class (if new-css-system
|
||||||
(dom/classnames (css :tool-window-content) true)
|
(dom/classnames (css :tool-window-content) true)
|
||||||
(dom/classnames :tool-window-content true))
|
(dom/classnames :tool-window-content true))
|
||||||
|
@ -526,6 +528,7 @@
|
||||||
:filtered? true
|
:filtered? true
|
||||||
:parent-size size-parent}]]]
|
:parent-size size-parent}]]]
|
||||||
[:div {:on-scroll on-scroll
|
[:div {:on-scroll on-scroll
|
||||||
|
:data-scroll-container true
|
||||||
:class (if new-css-system
|
:class (if new-css-system
|
||||||
(dom/classnames (css :tool-window-content) true)
|
(dom/classnames (css :tool-window-content) true)
|
||||||
(dom/classnames :tool-window-content true))
|
(dom/classnames :tool-window-content true))
|
||||||
|
|
|
@ -151,6 +151,13 @@
|
||||||
current
|
current
|
||||||
(recur (.-parentElement current) (dec current-count))))))
|
(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
|
(defn get-parent-with-selector
|
||||||
[^js node selector]
|
[^js node selector]
|
||||||
(loop [current node]
|
(loop [current node]
|
||||||
|
|
Loading…
Add table
Reference in a new issue