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

default-selection-autofocus #62

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

Conversation

BrianHung
Copy link
Contributor

@BrianHung BrianHung commented Aug 12, 2021

This PR removes hardcoded 0 value which assumes that a selection at the beginning of a document Selection.atStart has a position of 0. Depending on the document type, a valid selection at the start of the document may begin at a value larger than that (relevant comment: ueberdosis/tiptap#1595 (comment)).

Mainly fixes issue of autofocusing editor on mount and on yjs content load: selection is at beginning of document before yjs content load, and is at end of document after yjs load. Expected behavior is that selection stays at beginning of document.

absolutePositionToRelativePosition might still contain additional bugs because 1. there are other pos == 0 statements in the function logic 2. unknown whether (initial) selections at end of the document Selection.atEnd have problems.

BrianHung added a commit to BrianHung/y-prosemirror that referenced this pull request Aug 12, 2021
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.

1 participant