mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
🐛 Fix scroll when file menu open
This commit is contained in:
parent
3bc6d2b0a7
commit
6bf3363429
2 changed files with 16 additions and 9 deletions
|
@ -58,6 +58,9 @@
|
|||
project-id (:id project)
|
||||
team-id (:id team)
|
||||
|
||||
dashboard-local (mf/deref refs/dashboard-local)
|
||||
file-menu-open? (:menu-open dashboard-local)
|
||||
|
||||
default-project-id
|
||||
(mf/with-memo [projects]
|
||||
(->> (vals projects)
|
||||
|
@ -83,6 +86,7 @@
|
|||
|
||||
|
||||
[:div {:class (stl/css :dashboard-content)
|
||||
:style {:pointer-events (when file-menu-open? "none")}
|
||||
:on-click clear-selected-fn :ref container}
|
||||
(case section
|
||||
:dashboard-projects
|
||||
|
|
|
@ -388,15 +388,18 @@
|
|||
(on-menu-click event)))}
|
||||
menu-icon
|
||||
(when (and selected? file-menu-open?)
|
||||
[:& file-menu {:files (vals selected-files)
|
||||
:show? (:menu-open dashboard-local)
|
||||
:left (+ 24 (:x (:menu-pos dashboard-local)))
|
||||
:top (:y (:menu-pos dashboard-local))
|
||||
:navigate? true
|
||||
:on-edit on-edit
|
||||
:on-menu-close on-menu-close
|
||||
:origin origin
|
||||
:parent-id (str file-id "-action-menu")}])]]]]]))
|
||||
;; 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)
|
||||
:show? (:menu-open dashboard-local)
|
||||
:left (+ 24 (:x (:menu-pos dashboard-local)))
|
||||
:top (:y (:menu-pos dashboard-local))
|
||||
:navigate? true
|
||||
:on-edit on-edit
|
||||
:on-menu-close on-menu-close
|
||||
:origin origin
|
||||
:parent-id (str file-id "-action-menu")}]])]]]]]))
|
||||
|
||||
(mf/defc grid
|
||||
[{:keys [files project origin limit library-view? create-fn] :as props}]
|
||||
|
|
Loading…
Add table
Reference in a new issue