fix(editor): can not move carte at the end of inline element (#11558)

Close [BS-2922](https://linear.app/affine-design/issue/BS-2922/【移动端-ios】文档添加linked-page后,无法删除)
This commit is contained in:
L-Sun
2025-04-09 08:07:02 +00:00
parent 9cf5e034bb
commit 06497773a7
6 changed files with 68 additions and 15 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ import { expect } from '@playwright/test';
import stringify from 'json-stable-stringify';
import lz from 'lz-string';
import { ZERO_WIDTH_SPACE } from '../inline-editor.js';
import { currentEditorIndex } from '../multiple-editor.js';
import {
pressArrowRight,
@@ -1053,7 +1054,7 @@ export async function getIndexCoordinate(
}
export function inlineEditorInnerTextToString(innerText: string): string {
return innerText.replace('\u200B', '').trim();
return innerText.replace(ZERO_WIDTH_SPACE, '').trim();
}
export async function focusTitle(page: Page) {
+1 -5
View File
@@ -22,8 +22,4 @@ export async function getStringFromRichText(
}
// Why? we can't import from `@blocksuite/affine/std/inline` because playwright will throw an error
export const ZERO_WIDTH_SPACE = /Apple Computer/.test(
globalThis.navigator?.vendor
)
? '\u200C'
: '\u200B';
export const ZERO_WIDTH_SPACE = '\u200C';