mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 10:31:50 +08:00
fix(core): cannot space inside ai panel input (#12167)
### TL;DR fix: cannot space inside ai panel input > CLOSE BS-3428
This commit is contained in:
@@ -52,8 +52,9 @@ export function setupSpaceAIEntry(panel: AffineAIPanelWidget) {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
insertSpace(host);
|
insertSpace(host);
|
||||||
panel.hide();
|
panel.hide();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selection = host.selection.find(TextSelection);
|
const selection = host.selection.find(TextSelection);
|
||||||
|
|||||||
@@ -51,4 +51,21 @@ test.describe('AIBasic/Guidance', () => {
|
|||||||
expect(content).toBe(' ');
|
expect(content).toBe(' ');
|
||||||
}).toPass({ timeout: 5000 });
|
}).toPass({ timeout: 5000 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should support text with space in ai panel input', async ({
|
||||||
|
page,
|
||||||
|
utils,
|
||||||
|
}) => {
|
||||||
|
await utils.editor.focusToEditor(page);
|
||||||
|
await page.keyboard.press('Space');
|
||||||
|
await expect(page.locator('affine-ai-panel-widget')).toBeVisible();
|
||||||
|
|
||||||
|
await page.keyboard.insertText('Hello');
|
||||||
|
await page.keyboard.press('Space');
|
||||||
|
await page.keyboard.insertText('World');
|
||||||
|
await expect(async () => {
|
||||||
|
const input = await page.locator('ai-panel-input textarea');
|
||||||
|
expect(await input.inputValue()).toBe('Hello World');
|
||||||
|
}).toPass({ timeout: 5000 });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user