mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00: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:
@@ -8,10 +8,11 @@ import { expect, type Locator, type Page } from '@playwright/test';
|
||||
declare type _GLOBAL_ = typeof BlocksuiteEffects;
|
||||
|
||||
const EDGELESS_TOOLBAR_WIDGET = 'edgeless-toolbar-widget';
|
||||
export const ZERO_WIDTH_SPACE = '\u200C';
|
||||
export const ZERO_WIDTH_FOR_EMPTY_LINE =
|
||||
process.env.BROWSER === 'webkit' ? '\u200C' : '\u200B';
|
||||
|
||||
export function inlineEditorInnerTextToString(innerText: string): string {
|
||||
return innerText.replace(ZERO_WIDTH_SPACE, '').trim();
|
||||
return innerText.replace(ZERO_WIDTH_FOR_EMPTY_LINE, '').trim();
|
||||
}
|
||||
|
||||
const PARAGRAPH_BLOCK_LOCATOR = 'affine-paragraph';
|
||||
|
||||
Reference in New Issue
Block a user