Skip to content

Fix accent/dead key composition in House MD editor#411

Draft
arturo-ojeda wants to merge 1 commit intobasecamp:mainfrom
arturo-ojeda:fix/accent-composition-bug
Draft

Fix accent/dead key composition in House MD editor#411
arturo-ojeda wants to merge 1 commit intobasecamp:mainfrom
arturo-ojeda:fix/accent-composition-bug

Conversation

@arturo-ojeda
Copy link
Copy Markdown

The editor's beforeinput handler calls preventDefault() on all events, including insertCompositionText. This breaks the browser's internal composition tracking, causing getTargetRanges() to return stale ranges on subsequent composition events. Dead key accents (e.g. Option+E then 'a' for á) produce broken output like ´á instead of á.

Fix: track composition start position and length internally so insertCompositionText events use the correct replacement range regardless of the browser's stale target ranges.

Fixes #410

The editor's beforeinput handler calls preventDefault() on all events,
including insertCompositionText. This breaks the browser's internal
composition tracking, causing getTargetRanges() to return stale ranges
on subsequent composition events. Dead key accents (e.g. Option+E then
'a' for á) produce broken output like ´á instead of á.

Fix: track composition start position and length internally so
insertCompositionText events use the correct replacement range
regardless of the browser's stale target ranges.

Fixes basecamp#410

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 28, 2026 20:57
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arturo-ojeda arturo-ojeda marked this pull request as draft March 28, 2026 20:58
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.

Text editor breaks when using accents

2 participants