facebook / facebook/lexical

Bug: Cursor Positioning Problem During Text Composition in Specific Fonts with Composite Languages like Korean

Open
#4,753 3 comments 7 reactions 0 assignees View on GitHub
composition
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

Lexical version: 0.11.1
Chrome version: 114.0.5735.198(Official build) (arm64)

I have encountered the exact same issue as described in https://github.com/facebook/lexical/issues/2726.

## Steps To Reproduce

1. Visit [demo page](https://codesandbox.io/s/lexical-plain-text-example-forked-kckvss) in a browser built on top of Chromium.
2. Select a font from 'Pretendard', or 'Noto Sans KR'
3. Type something in Korean into the editor. Ensure you are typing in a language that supports word composition. (i.e. [cjk character](https://en.wikipedia.org/wiki/CJK_characters))

![image](https://github.com/facebook/lexical/assets/79959835/bdd0432b-8fee-41f2-a5f7-fdc9fc6e221b)

Link to code example: [codesandbox](https://codesandbox.io/s/lexical-plain-text-example-forked-kckvss)

## The current behavior
- If certain fonts are dynamically subset-loaded and input is provided in a composition-based language (e.g., a CJK character), the cursor may be positioned incorrectly.
- This does not occur in browsers built on engines other than Chromium.
- This does not occur unless a font that is divided into subsets is being used.
- This only occurs when a word is in composition mode.

https://github.com/facebook/lexical/assets/79959835/277d95ef-ea93-405b-82a0-58283f43fc69

## The expected behavior
- The cursor is always in the right place.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.