View Single Post
Old 06-11-2018, 12:57 PM   #41
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,842
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi Kovid,

Using normalize() seems to help but ... calling normalize() on the anchorNode or its parent or even the entire document seems to clear/reset the cursor or highlighted region in BookView. My guess is the highlighted code is actually the part that is being normalized away. This same javascript routine is used to save the cursor position while editing in BookView and having your highlighted text randomly become unhighlighted makes things a bit tough.

I guess I could simply always return the parent node of the text field as the cursor position.

Any other advice?

KevinH





Quote:
Originally Posted by kovidgoyal View Post
@KevinH: You need to normalize() before calculating the path. https://developer.mozilla.org/en-US/...Node/normalize
KevinH is offline   Reply With Quote