mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
fix(editor): ime input error at empty line (#11636)
Close [BS-3106](https://linear.app/affine-design/issue/BS-3106/mac-chrom在空行使用ime输入,文档卡住)
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
||||
assertRichTextInlineDeltas,
|
||||
assertRichTextInlineRange,
|
||||
} from '../utils/asserts.js';
|
||||
import { ZERO_WIDTH_SPACE } from '../utils/inline-editor.js';
|
||||
import { ZERO_WIDTH_FOR_EMPTY_LINE } from '../utils/inline-editor.js';
|
||||
import { test } from '../utils/playwright.js';
|
||||
|
||||
test('add inline latex at the start of line', async ({ page }) => {
|
||||
@@ -162,13 +162,13 @@ test('latex editor', async ({ page }) => {
|
||||
);
|
||||
|
||||
await pressBackspaceWithShortKey(page, 2);
|
||||
expect(await latexEditorLine.innerText()).toBe(ZERO_WIDTH_SPACE);
|
||||
expect(await latexEditorLine.innerText()).toBe(ZERO_WIDTH_FOR_EMPTY_LINE);
|
||||
await undoByKeyboard(page);
|
||||
expect(await latexEditorLine.innerText()).toBe(
|
||||
'ababababababababababababababababababababababababab'
|
||||
);
|
||||
await redoByKeyboard(page);
|
||||
expect(await latexEditorLine.innerText()).toBe(ZERO_WIDTH_SPACE);
|
||||
expect(await latexEditorLine.innerText()).toBe(ZERO_WIDTH_FOR_EMPTY_LINE);
|
||||
await undoByKeyboard(page);
|
||||
expect(await latexEditorLine.innerText()).toBe(
|
||||
'ababababababababababababababababababababababababab'
|
||||
@@ -200,7 +200,7 @@ test('latex editor', async ({ page }) => {
|
||||
|
||||
await selectAllByKeyboard(page);
|
||||
await pressBackspace(page);
|
||||
expect(await latexEditorLine.innerText()).toBe(ZERO_WIDTH_SPACE);
|
||||
expect(await latexEditorLine.innerText()).toBe(ZERO_WIDTH_FOR_EMPTY_LINE);
|
||||
|
||||
// highlight
|
||||
await type(
|
||||
|
||||
Reference in New Issue
Block a user