mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 17:30:07 +00:00
fix mmb navigation when click starts on Vue nodes (#5921)
## Summary Fixes https://github.com/Comfy-Org/ComfyUI_frontend/issues/5860 by updating Vue node pointer interactions to forward middle mouse button events to canvas instead of handling them locally. ## Review Focus Middle mouse button event detection logic using both `button` property and `buttons` bitmask for cross-browser compatibility. Test coverage for pointer event forwarding behavior. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5921-fix-mmb-navigation-when-click-starts-on-Vue-nodes-2826d73d3650819688eec4600666755d) by [Unito](https://www.unito.io) --------- Co-authored-by: DrJKL <DrJKL@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { isMiddlePointerInput } from '@/base/pointerUtils'
|
||||
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||
import { app } from '@/scripts/app'
|
||||
@@ -59,6 +60,11 @@ export function useCanvasInteractions() {
|
||||
* be forwarded to canvas (e.g., space+drag for panning)
|
||||
*/
|
||||
const handlePointer = (event: PointerEvent) => {
|
||||
if (isMiddlePointerInput(event)) {
|
||||
forwardEventToCanvas(event)
|
||||
return
|
||||
}
|
||||
|
||||
// Check if canvas exists using established pattern
|
||||
const canvas = getCanvas()
|
||||
if (!canvas) return
|
||||
|
||||
Reference in New Issue
Block a user