Skip to content

Commit de8bea8

Browse files
authored
fix: Slash Command Android Chrome Issue #437 (#443)
* #437 Slash Command Android Chrome Issue fixed * #437 extracting repeating logic into a seperate fn * #437 updated code according to new files
1 parent 1475ab0 commit de8bea8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/core/src/extensions/SuggestionMenu/SuggestionPlugin.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,28 @@ export class SuggestionMenuProseMirrorPlugin<
267267

268268
return true;
269269
}
270+
return false;
271+
},
272+
handleTextInput(view, _from, _to, text) {
273+
const suggestionPluginState: SuggestionPluginState = (
274+
this as Plugin
275+
).getState(view.state);
270276

277+
if (
278+
triggerCharacters.includes(text) &&
279+
suggestionPluginState === undefined
280+
) {
281+
view.dispatch(
282+
view.state.tr
283+
.insertText(text)
284+
.scrollIntoView()
285+
.setMeta(suggestionMenuPluginKey, {
286+
triggerCharacter: text,
287+
})
288+
);
289+
290+
return true;
291+
}
271292
return false;
272293
},
273294

0 commit comments

Comments
 (0)