Skip to content

Commit d3773c7

Browse files
yandifbdbchCopilot
authored
fix: avoid selection update during IME composition (#4546) (#6879)
* fix: avoid selection update during IME composition (#4546) * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix IME handling for Chinese text input Fixed an issue where the input method editor (IME) failed to handle Chinese text correctly when entering the first word. Users can now input multiple words as expected. --------- Co-authored-by: bdbch <6538827+bdbch@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 895c73f commit d3773c7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tiptap/extension-details": patch
3+
---
4+
5+
Fixed an issue where the input method editor (IME) failed to handle Chinese text correctly when entering the first word. Users can now input multiple words as expected.

packages/extension-details/src/details.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,12 @@ export const Details = Node.create<DetailsOptions>({
376376
key: new PluginKey('detailsSelection'),
377377
appendTransaction: (transactions, oldState, newState) => {
378378
const { editor, type } = this
379+
const isComposing = editor.view.composing
380+
381+
if (isComposing) {
382+
return
383+
}
384+
379385
const selectionSet = transactions.some(transaction => transaction.selectionSet)
380386

381387
if (!selectionSet || !oldState.selection.empty || !newState.selection.empty) {

0 commit comments

Comments
 (0)