fix(editor): prevent Tab key propagation outside editor (#11531)

Closes: BS-2964
This commit is contained in:
Saul-Mirone
2025-04-08 10:03:06 +00:00
parent 280227fa5f
commit 780c35eabe
5 changed files with 75 additions and 16 deletions

View File

@@ -1,3 +1,4 @@
import { toolbarButtons } from '@affine-test/kit/bs/linked-toolbar';
import { waitNextFrame } from '@affine-test/kit/bs/misc';
import { test } from '@affine-test/kit/playwright';
import { clickEdgelessModeButton } from '@affine-test/kit/utils/editor';
@@ -27,22 +28,6 @@ test.beforeEach(async ({ page }) => {
await waitForEmptyEditor(page);
});
function toolbarButtons(page: Page) {
const toolbar = page.locator('affine-toolbar-widget editor-toolbar');
const switchViewBtn = toolbar.getByLabel('Switch view');
const inlineViewBtn = toolbar.getByLabel('Inline view');
const cardViewBtn = toolbar.getByLabel('Card view');
const embedViewBtn = toolbar.getByLabel('Embed view');
return {
toolbar,
switchViewBtn,
inlineViewBtn,
cardViewBtn,
embedViewBtn,
};
}
async function enableEmojiDocIcon(page: Page) {
// Opens settings panel
await openEditorSetting(page);