Fix getBookmark bug #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've been banging my head against 'can't read property inlineContent of undefined' for a while and I think I may have found the culprit. It seems
Selection.betweenexpects aResolvedPosbut heregetBookmarkwas passing the number of a pos instead. This was being fired byprosemirror-history. I think this slipped under the radar because it's looks like it only fires in certain history grouping scenarios cases but even then I'm surprised this hasn't surfaced earlier so am a bit confused! Either way, it fixes a couple of tests I've been struggling with.I guess this only gets called when you have a custom selection class that doesn't override this method (the built in ones do override it), and that might explain how it sat there for so long. But yeah, this is the kind of thing where TypeScript would help.
Makes sense, I was just using a raw
Selectionclass there which probably could have avoided that bug in hindsight.You don't want to ever use a raw
Selectioninstance. It'll be missing methods.Only really for a small edge case in text ... is there any reason it’s
exported from the package if it’s not usable?
On Mon, 2 Jul 2018 at 16:07, Marijn Haverbeke notifications@github.com
wrote:
It can be used as superclass for custom selection classes.