mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +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:
@@ -14,7 +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 { ZERO_WIDTH_FOR_EMPTY_LINE } from '../inline-editor.js';
|
||||
import { currentEditorIndex } from '../multiple-editor.js';
|
||||
import {
|
||||
pressArrowRight,
|
||||
@@ -1054,7 +1054,7 @@ export async function getIndexCoordinate(
|
||||
}
|
||||
|
||||
export function inlineEditorInnerTextToString(innerText: string): string {
|
||||
return innerText.replace(ZERO_WIDTH_SPACE, '').trim();
|
||||
return innerText.replace(ZERO_WIDTH_FOR_EMPTY_LINE, '').trim();
|
||||
}
|
||||
|
||||
export async function focusTitle(page: Page) {
|
||||
|
||||
@@ -22,4 +22,5 @@ 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 = '\u200C';
|
||||
export const ZERO_WIDTH_FOR_EMPTY_LINE =
|
||||
process.env.BROWSER === 'webkit' ? '\u200C' : '\u200B';
|
||||
|
||||
Reference in New Issue
Block a user