-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve suggestion handling for chinese input #1292
Improve suggestion handling for chinese input #1292
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@mehul-m-prajapati is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe. |
@@ -85,7 +85,7 @@ class SuggestionMenuView< | |||
|
|||
this.pluginState = stopped ? prev : next; | |||
|
|||
if (stopped || !this.editor.isEditable) { | |||
if (stopped || !this.editor.isEditable || this.pluginState?.composing) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like the suggestion menu to always open whenever the user is typing between the compositionStart and compositionEnd events.But here colsed the menu.Maybe like the code follows?
...
let _isComposing = false;
export class SuggestionMenuProseMirrorPlugin<
...
apply(transaction, prev, _oldState, newState): SuggestionPluginState {
if (_isComposing) {
return prev;
}
...
props: {
handleDOMEvents:{
compositionstart:(view)=>{
console.log('run compositionstart');
_isComposing = true;
view.dispatch(view.state.tr.setMeta("isComposing", true));
return false;
},
compositionend:(view)=>{
console.log('run compositionend');
_isComposing = false;
view.dispatch(view.state.tr.setMeta("isComposing", false));
return false;
}
},
handleTextInput(view, _from, _to, text) {
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ClytzeL : I have updated the code. Can you please test again ?
fixes #1283
/claim #1283