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

Update current.cursor references to current[cursorStateField]? #86

Open
milesingrams opened this issue Dec 10, 2021 · 2 comments · May be fixed by #159
Open

Update current.cursor references to current[cursorStateField]? #86

milesingrams opened this issue Dec 10, 2021 · 2 comments · May be fixed by #159

Comments

@milesingrams
Copy link

milesingrams commented Dec 10, 2021

Not sure if this was intended, but since the cursorStateField is customizable I figured the references to current.cursor should be changed to current[cursorStateField]. I may not understand the code fully though so apologies if this is there for a reason.

if (current.cursor == null || !Y.compareRelativePositions(Y.createRelativePositionFromJSON(current.cursor.anchor), anchor) || !Y.compareRelativePositions(Y.createRelativePositionFromJSON(current.cursor.head), head)) {
awareness.setLocalStateField(cursorStateField, {
anchor, head
})
}
} else if (current.cursor != null && relativePositionToAbsolutePosition(ystate.doc, ystate.type, Y.createRelativePositionFromJSON(current.cursor.anchor), ystate.binding.mapping) !== null) {

@DAlperin
Copy link

DAlperin commented Jan 1, 2022

This is fixed by #88

@andrictham
Copy link

See #159 for an attempted fix for this.

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 a pull request may close this issue.

3 participants