diff --git a/yazi-plugin/preset/components/root.lua b/yazi-plugin/preset/components/root.lua index e4fb0a97..201d37fa 100644 --- a/yazi-plugin/preset/components/root.lua +++ b/yazi-plugin/preset/components/root.lua @@ -50,14 +50,12 @@ end -- Mouse events function Root:click(event, up) - if tostring(cx.layer) ~= "mgr" then - return - end - local c = Root._dragging or ya.child_at(ui.Rect { x = event.x, y = event.y }, self:reflow()) Root._dragging = not up and c or nil - return c and c:click(event, up) + if tostring(cx.layer) == "mgr" then + return c and c:click(event, up) + end end function Root:scroll(event, step)