iOS-Korean Autocomplete: Touch Selection Duplicates Last Korean IME Character

# iOS/iPadOS Autocomplete: Touch Selection Duplicates Last Korean IME Character

## Environment

- **Platform**: iOS/iPadOS (both affected)

- **Obsidian Version**: Latest (as of July 2026)

- **Input Method**: iOS Default Korean IME (한글)

- **Device**: iPhone & iPad

## Observed Behavior

When using Korean IME with autocomplete suggestions:

1. Type Korean text normally (e.g., “테스트”)

2. Autocomplete popup appears with suggestions

3. **Touch** the suggestion to select it

4. **Result**: The last Korean character before autocomplete gets duplicated in the final text

  • Example: Intended input “테스트” + autocomplete suggestion “완료” → Result “테스트트완료” (ㅌ duplicated)

## Expected Behavior

Touching the autocomplete suggestion should insert only the suggested text, without duplicating any IME buffer characters.

## Workaround

The issue **does NOT occur** when using **Enter key** to select autocomplete suggestions. Only touch selection triggers the duplication.

## Root Cause Analysis

This appears to be an event timing issue on iOS WebView:

- Touch event fires before `compositionend` IME event completes

- The last character in the IME buffer hasn’t been committed yet when the touch selection triggers

- Both the buffer character and the autocomplete completion get inserted simultaneously

## Repro Steps

1. Open any note in Obsidian iOS/iPadOS

2. Switch keyboard to Korean IME

3. Type any Korean word: “테스트”

4. Wait for autocomplete suggestions to appear

5. **Touch** (not enter key press) any suggestion

6. Observe the last Korean character gets duplicated

## Environment Details

- Tested on: iPad OS, iPhone iOS

- Autocomplete: Default enabled (not disabled)

- Vault: Standard vault with no community plugins

- No keyboard settings that could workaround this (tried deleting/re-adding Korean keyboard)

## Suggested Fix

The autocomplete handler should ensure `compositionend` event is fully processed before executing the touch-triggered selection handler.

-–

**Note**: This is a clear iOS-specific issue that does NOT occur on macOS, Windows, or Android with the same Korean IME setup.

Hello

Does it happen in source mode?

If you open iOS/Safari and try here, does it happen? If so can make a screen recording?

Thanks