mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 10:00:08 +00:00
Forward scroll unless focused (#6597)
## Summary Forward wheel events to the canvas unless a wheel-capturing element is focused, and ensure the Load3D scene becomes focusable on pointer interaction so its wheel zoom/pan works after the user clicks into it. ## Changes - **What**: gate wheel forwarding on focused capture elements; focus the Load3D scene container on pointerdown to opt into wheel capture. - **Dependencies**: none ## Review Focus - Validate wheel forwarding behavior across focusable inputs vs. non-focusable capture zones. - Confirm Load3D zoom/pan only captures wheel after a user click (canvas pan should still work when merely hovering). ## Screenshots (if applicable) N/A --------- Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Subagent 5 <subagent@example.com> Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
ref="container"
|
||||
class="relative h-full w-full min-h-[200px]"
|
||||
data-capture-wheel="true"
|
||||
@pointerdown.stop
|
||||
tabindex="-1"
|
||||
@pointerdown.stop="focusContainer"
|
||||
@pointermove.stop
|
||||
@pointerup.stop
|
||||
@mousedown.stop
|
||||
@@ -45,6 +46,10 @@ const props = defineProps<{
|
||||
|
||||
const container = ref<HTMLElement | null>(null)
|
||||
|
||||
function focusContainer() {
|
||||
container.value?.focus()
|
||||
}
|
||||
|
||||
const { isDragging, dragMessage, handleDragOver, handleDragLeave, handleDrop } =
|
||||
useLoad3dDrag({
|
||||
onModelDrop: async (file) => {
|
||||
|
||||
Reference in New Issue
Block a user