Selection problem/bug

I’m having a problem with simple text selection using Chrome in the special case that the selection starts at the very end of one span. In this case, the letter ‘f’ in the video is in it’s own span (because it has marks that make it different from the spans on either side of it).

I can select from the previous span across the ‘f’ with no problem, but starting at the very end of the prior span or at the end of the ‘f’ will result in a cursor drag but no selection.

This problem goes away if the selectionToDom() call is removed from the bottom of: SelectionReader.prototype.readFromDOM or if the selectionToDom() call is removed from EditorView.prototype.updateState. I can’t really understand what the purpose of calling selectionToDOm from within readFromDom might be – can it be removed? Perhaps this is related to the issue indicated in selectionCollapsed() since the selection is reported as collapsed even though it’s not.

Hi. SelectionReader doesn’t exist anymore since version 1.9. Have you tried if the problem is still there with a more recent version?

Ahh, so far so good. Thanks!

BTW, when I updated to the new code, I found the behavior of sinkListItem had intentionally changed to not copy the attributes of the parent node for items that are created. Since I was depending on the previous behavior, I was wondering if it would make sense to allow that as an option. In the meantime, I’ve just made my own version of sinkListItem.

I’d be okay with a pull request that adds an optional second argument to sinkListItem that’s an options object (for potential future extension) allowing you to control this.