Improve suggestion handling for chinese input#1292
Closed
mehul-m-prajapati wants to merge 2 commits intoTypeCellOS:mainfrom
mehul-m-prajapati:composition-event-fix
Closed
Improve suggestion handling for chinese input#1292mehul-m-prajapati wants to merge 2 commits intoTypeCellOS:mainfrom mehul-m-prajapati:composition-event-fix
mehul-m-prajapati wants to merge 2 commits intoTypeCellOS:mainfrom
mehul-m-prajapati:composition-event-fix
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. |
ClytzeL
reviewed
Dec 2, 2024
| 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.
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) {
...
Author
There was a problem hiding this comment.
@ClytzeL : I have updated the code. Can you please test again ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1283
/claim #1283