File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -137,18 +137,28 @@ export function Suggestion({
137
137
range : { } ,
138
138
query : null ,
139
139
text : null ,
140
+ composing : false ,
140
141
}
141
142
} ,
142
143
143
144
// Apply changes to the plugin state from a view transaction.
144
145
apply ( transaction , prev ) {
146
+ const { composing } = editor . view
145
147
const { selection } = transaction
148
+ const { empty, from } = selection
146
149
const next = { ...prev }
147
150
151
+ next . composing = composing
152
+
148
153
// We can only be suggesting if there is no selection
149
- if ( selection . from === selection . to ) {
154
+ // or a composition is active (see: https://github.com/ueberdosis/tiptap/issues/1449)
155
+ if ( empty || editor . view . composing ) {
150
156
// Reset active state if we just left the previous suggestion range
151
- if ( selection . from < prev . range . from || selection . from > prev . range . to ) {
157
+ if (
158
+ ( from < prev . range . from || from > prev . range . to )
159
+ && ! composing
160
+ && ! prev . composing
161
+ ) {
152
162
next . active = false
153
163
}
154
164
You can’t perform that action at this time.
0 commit comments