Skip to content

Commit

Permalink
Update packages/lexical-rich-text/src/index.ts
Browse files Browse the repository at this point in the history
Co-authored-by: wnhlee <[email protected]>
  • Loading branch information
DeadIntegral and 2wheeh authored Apr 4, 2024
1 parent 3bb36a0 commit 8fb9294
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/lexical-rich-text/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,12 @@ export function registerRichText(editor: LexicalEditor): () => void {

// Exception handling for iOS native behavior instead of Lexical's behavior when using Korean on iOS devices.
// On other devices, if you backspace during composing, you get a keyCode of 229 (composing state), but on iOS, the behavior is different: it outputs a keyCode of 8 and appends the remnants of the composing character to the previous character.
if (event.keyCode === 8 && navigator.language === 'ko-KR' && /iPad|iPhone|iPod/.test(navigator.userAgent)) {
return false
if (
event.keyCode === 8 &&
navigator.language === 'ko-KR' &&
/iPad|iPhone|iPod/.test(navigator.userAgent)
) {
return false;
}

event.preventDefault();
Expand Down

0 comments on commit 8fb9294

Please sign in to comment.