Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/web/src/components/ComposerPromptEditorTiptap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,18 @@ function ComposerPromptEditorTiptapInner(props: ComposerPromptEditorProps) {
return handled;
},
handleTextInput: (view, from, to, text) => {
// Dead keys can replace a composition range without a user selection.
// Only surround explicitly selected text; let native composition finish.
const selection = view.state.selection;
if (
view.composing ||
!(selection instanceof TextSelection) ||
selection.empty ||
selection.from !== from ||
selection.to !== to
) {
return false;
}
if (text.length !== 1) return false;
const closer = SURROUND_CLOSE[text];
if (!closer || from === to) return false;
Expand Down
Loading