Closed chacha912 closed 5 months ago
I'll try fix this 🙂
<--- For record keeping ---->
i am trying to update Selection on remote edit operation triggered
const from = op.from;
...
const index = quill.getSelection().index;
const length = quill.getSelection().length;
if(from <= index){
quill.setSelection(index + insert.length, length, 'user');
}
and expect the setSelection
to trigger set presence
which is included in selection-change
event callback.
it works, but problem is it seems to trigger setSelection
twice. and i don't know why.
maybe setSelection by user
triggers setSelection one more by api
(https://quilljs.com/docs/api/#setselection)
1.ClientA
selects 123
.
123
but in ClientA selection goes to 234
. it moves on more index than expected.@ed-jinyoung-park, thank you for taking on this issue!
Have there been any updates since the last comment? If the problem continues, could you provide a draft PR or share the working branch so that we can try running the code? This would enable us to know which version of Yorkie you're testing with and where the issue is occurring.
@chacha912 thanks for suggestion. i'll try to share draft PR soon.
What happened:
In the quill example, when editing before a remote cursor, the remote cursor position is not maintained.
What you expected to happen:
Regardless of local edits, the remote cursor or selection should be preserved.
How to reproduce it (as minimally and precisely as possible):
1)
ClientB
selects12
. WhenClientA
enters text before12
, the selection for12
is not maintained.2)
ClientB
places the cursor after3
. WhenClientA
enters text before3
,ClientB
's cursor position is not maintained.Anything else we need to know?:
Related #348
Environment:
yorkie version
): v0.3.5