Skip to content
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

feat: handle composition #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

vincentdchan
Copy link

Why?

When the user inputs with IME, the middle process will be committed, that's unnecessary. This PR wants to optimize this behaviour. When the editor is in the composing state, Yjs don't need to commit the changes. When the composition was finished, the plugin commits the changes.

Before

2022-05-07 22 34 31

After

2022-05-07 22 31 58

@dmonad
Copy link
Member

dmonad commented May 8, 2022

Hi @vincentdchan, thank you for this!

I'm wondering how this workaround behaves in a collaborative environment. I expect that remote changes will delete the composing state which is probably worse than committing the composing state.

Would it be possible for you to test if this works reliably when other people are editing the same document / paragraph?

@cqh963852
Copy link

I have create a project with y-prosemirror. It use vincentdchan:feat/ime branch.

It has some problem. While delete a some content. The user is under composing, cursor comes wrong.

I have check the shimo's behavior. During composing, It much like a offline editor.

@cqh963852
Copy link

  1. type 123456
  2. image
  3. insert between 34 with composing aa
  4. image

cursor data received by another user
3baeb6547606f644f94dc097a46d0f4

@cqh963852
Copy link

cqh963852 commented Aug 27, 2022

😀I have implement a custom provider based on socket.io.
While composing, I make sync suspense. Just like disconnect.
After composing, I send a sync message. It works fine.
You can check the demo at http://43.134.196.209:3000/cl7a7opuy0028drwid01c38vf

😔I tried modify the demo in y-prosemirror, but the disconnect action in y-webrtc provider not works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants