0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fix scroll when file menu open

This commit is contained in:
alonso.torres 2024-03-14 14:19:55 +01:00
parent 3bc6d2b0a7
commit 6bf3363429
2 changed files with 16 additions and 9 deletions

View file

@ -58,6 +58,9 @@
project-id (:id project) project-id (:id project)
team-id (:id team) team-id (:id team)
dashboard-local (mf/deref refs/dashboard-local)
file-menu-open? (:menu-open dashboard-local)
default-project-id default-project-id
(mf/with-memo [projects] (mf/with-memo [projects]
(->> (vals projects) (->> (vals projects)
@ -83,6 +86,7 @@
[:div {:class (stl/css :dashboard-content) [:div {:class (stl/css :dashboard-content)
:style {:pointer-events (when file-menu-open? "none")}
:on-click clear-selected-fn :ref container} :on-click clear-selected-fn :ref container}
(case section (case section
:dashboard-projects :dashboard-projects

View file

@ -388,6 +388,9 @@
(on-menu-click event)))} (on-menu-click event)))}
menu-icon menu-icon
(when (and selected? file-menu-open?) (when (and selected? file-menu-open?)
;; When the menu is open we disable events in the dashboard. We need to force pointer events
;; so the menu can be handled
[:div {:style {:pointer-events "all"}}
[:& file-menu {:files (vals selected-files) [:& file-menu {:files (vals selected-files)
:show? (:menu-open dashboard-local) :show? (:menu-open dashboard-local)
:left (+ 24 (:x (:menu-pos dashboard-local))) :left (+ 24 (:x (:menu-pos dashboard-local)))
@ -396,7 +399,7 @@
:on-edit on-edit :on-edit on-edit
:on-menu-close on-menu-close :on-menu-close on-menu-close
:origin origin :origin origin
:parent-id (str file-id "-action-menu")}])]]]]])) :parent-id (str file-id "-action-menu")}]])]]]]]))
(mf/defc grid (mf/defc grid
[{:keys [files project origin limit library-view? create-fn] :as props}] [{:keys [files project origin limit library-view? create-fn] :as props}]