fix: edgeless note mask does not restore after dnd dropping (#12495)

This commit is contained in:
doouding
2025-05-26 05:03:10 +00:00
parent 6518c5904e
commit 81be5818cc
2 changed files with 15 additions and 2 deletions

View File

@@ -1569,6 +1569,11 @@ export class DragEventWatcher {
view.hideMask = false; view.hideMask = false;
} }
}, },
onDrop: () => {
if (isNote && 'hideMask' in view) {
view.hideMask = false;
}
},
setDropData: () => { setDropData: () => {
return { return {
modelId: view.model.id, modelId: view.model.id,

View File

@@ -149,12 +149,20 @@ test('drag handle should work across multiple notes', async ({ page }) => {
await waitNextFrame(page); await waitNextFrame(page);
await assertRichTexts(page, ['456', '789', '000', '123']); await assertRichTexts(page, ['456', '789', '000', '123']);
await page const rect = await page
.locator('affine-edgeless-note') .locator('affine-edgeless-note')
.nth(1) .nth(1)
.locator('affine-paragraph') .locator('affine-paragraph')
.nth(1) .nth(1)
.click({ clickCount: 3 }); .boundingBox();
if (!rect) {
throw new Error('Missing bounding box for the paragraph');
}
await page.mouse.click(rect.x + 10, rect.y + 10, {
clickCount: 2,
});
await dragHandleFromBlockToBlockBottomById(page, '3', '4'); await dragHandleFromBlockToBlockBottomById(page, '3', '4');
await waitNextFrame(page); await waitNextFrame(page);
await expect(page.locator('.affine-drag-handle-container')).toBeHidden(); await expect(page.locator('.affine-drag-handle-container')).toBeHidden();