facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.62k stars 1.67k forks source link

Bug: CJK text editing does not work properly on Windows 10, Chrome 128 versions. #6577

Open yunseop-dev opened 2 months ago

yunseop-dev commented 2 months ago

Lexical version: 0.14.5

Steps To Reproduce

  1. Windows 10, Chrome 128 versions.

The current behavior

Aug-30-2024 21-08-25

There is a problem that text editing is not possible as in the attached image.

It does not occur in Windows 11 versions.

The expected behavior

Text must be entered normally.

Impact of fix

This bug occurs after the Chrome 128 version update. It didn't happen in 127 version.

Looking at the release notes for the Chrome 128 version, there was an update regarding the cachePosition. I think this might have affected it.

link: https://developer.chrome.com/release-notes/128#documentcaretpositionfrompoint

etrepum commented 2 months ago

Are you able to reproduce this with 0.17.1? There is only one development branch of Lexical, only the latest version receives updates, fixes are not backported to older versions.

yunseop-dev commented 2 months ago

@etrepum Yes, it's an issue with the latest version as well. The thing that's unique is that it only happens with Windows 10, Chrome 128 versions. It doesn't happen with Windows 11, Chrome 128.

yunseop-dev commented 2 months ago

@etrepum

c1 c3

I found the cause of the problem.

I was creating and using a custom node, but there was a problem in the process of fetching the text through API requests.

The newly created custom node in the editor found no problems with coming, and analyzed the difference between the newly created node and the node called through API requests.

As a result, I found that the __format value of the node called through API request was undefined, and I overridden the getFormat method on the custom node to return 0, and I confirmed that the bug that occurred during text composition disappeared.

A bug that wasn't happening with Chrome 127+ Windows 10 When I see this happening with Chrome 128+ Windows 10, the Chrome 128 version update definitely seems to have affected it.