Skip to content

Fix broken Korean IME composition on iOS Safari in CodeMirror editors#7965

Open
yunttai wants to merge 1 commit intorequarks:mainfrom
yunttai:fix/ios-korean-ime-codemirror
Open

Fix broken Korean IME composition on iOS Safari in CodeMirror editors#7965
yunttai wants to merge 1 commit intorequarks:mainfrom
yunttai:fix/ios-korean-ime-codemirror

Conversation

@yunttai
Copy link

@yunttai yunttai commented Mar 21, 2026

Summary

This changes the CodeMirror-based Wiki.js editors to use the textarea input path on iOS devices while preserving the existing contenteditable path elsewhere.

Root Cause

The Markdown, AsciiDoc, and Code editors all use CodeMirror 5 with inputStyle: "contenteditable". On iOS Safari, that input path can interfere with Korean IME composition and cause separated jamo, duplicated or missing characters, unexpected deletion, and cursor jumps.

Wiki.js does not add its own composition or beforeinput handling around these editors, so the safest local mitigation point is the CodeMirror configuration used by the Wiki.js editor components.

Changes

  • add a small helper to choose a safer CodeMirror input style on iOS
  • apply it to the Markdown, AsciiDoc, and Code page editors
  • apply it to the page properties CodeMirror instances for consistency
  • add focused helper coverage for iOS detection

Why This Is Minimal And Safe

  • iOS-only behavior change
  • no broad refactor
  • no changes to save, autosave, preview, paste, Enter, Backspace, or selection logic
  • desktop and non-iOS browsers stay on the current path

Validation

Manual real-device verification completed on an iPhone in Safari with the Korean keyboard:

  • Hangul composition in the Markdown editor now behaves normally
  • progressive input from jamo to a composed Hangul word behaves correctly
  • editing in the middle of composed Korean text remains stable
  • Backspace, Enter/newline, paste, cursor movement, and English typing behaved as expected

Automated check completed:

  • jest --runTestsByPath client/helpers/codemirror.test.js --runInBand

Full project test suite was not run as part of this change.

@auto-assign auto-assign bot requested a review from NGPixel March 21, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants