mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
[Bug] Fix selection toolbox select+drag (#3235)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -53,6 +53,23 @@ test.describe('Selection Toolbox', () => {
|
|||||||
expect(Math.round(boundingBox!.y)).toBeCloseTo(60, -1)
|
expect(Math.round(boundingBox!.y)).toBeCloseTo(60, -1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('hide when select and drag happen at the same time', async ({
|
||||||
|
comfyPage
|
||||||
|
}) => {
|
||||||
|
await comfyPage.loadWorkflow('single_ksampler')
|
||||||
|
const node = (await comfyPage.getNodeRefsByTitle('KSampler'))[0]
|
||||||
|
const nodePos = await node.getPosition()
|
||||||
|
|
||||||
|
// Drag on the title of the node
|
||||||
|
await comfyPage.page.mouse.move(nodePos.x + 100, nodePos.y - 15)
|
||||||
|
await comfyPage.page.mouse.down()
|
||||||
|
await comfyPage.page.mouse.move(nodePos.x + 200, nodePos.y + 200)
|
||||||
|
await comfyPage.nextFrame()
|
||||||
|
await expect(
|
||||||
|
comfyPage.page.locator('.selection-overlay-container')
|
||||||
|
).not.toBeVisible()
|
||||||
|
})
|
||||||
|
|
||||||
test('shows border only with multiple selections', async ({ comfyPage }) => {
|
test('shows border only with multiple selections', async ({ comfyPage }) => {
|
||||||
// Select single node
|
// Select single node
|
||||||
await comfyPage.selectNodes(['KSampler'])
|
await comfyPage.selectNodes(['KSampler'])
|
||||||
|
|||||||
@@ -91,7 +91,12 @@ watch(
|
|||||||
positionSelectionOverlay(canvasStore.canvas as LGraphCanvas)
|
positionSelectionOverlay(canvasStore.canvas as LGraphCanvas)
|
||||||
}, 100)
|
}, 100)
|
||||||
} else {
|
} else {
|
||||||
visible.value = false
|
// Selection change update to visible state is delayed by a frame. Here
|
||||||
|
// we also delay a frame so that the order of events is correct when
|
||||||
|
// the initial selection and dragging happens at the same time.
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
visible.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3064,6 +3064,9 @@
|
|||||||
"extra_pos_embedder_": {
|
"extra_pos_embedder_": {
|
||||||
"name": "extra_pos_embedder."
|
"name": "extra_pos_embedder."
|
||||||
},
|
},
|
||||||
|
"final_layer_": {
|
||||||
|
"name": "capa_final."
|
||||||
|
},
|
||||||
"model1": {
|
"model1": {
|
||||||
"name": "model1"
|
"name": "model1"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user