Skip to content

[Documentation] Locator -> Location -> progression and totalProgression properties calculation #462

Answered by mickael-menu
vedat73 asked this question in Q&A
Discussion options

You must be logged in to vote

That's right. When you use navigator.currentSelection, all the words on the visible page will have the same progression: the scroll progression of the current page.

As you can see below, we first take into account text, then locations.fragments (for HTML IDs) and finally the locations.progression, when resolving a Locator.

if locator.text.highlight != nil {
scroll(toLocator: locator, completion: completion)
// FIXME: find the first fragment matching a tag ID (need a regex)
} else if let id = locator.locations.fragments.first, !id.isEmpty {
scroll(toTagID: id, com…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mickael-menu
Comment options

Answer selected by vedat73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
documentation Improvements or additions to documentation
2 participants
Converted from issue

This discussion was converted from issue #461 on July 08, 2024 07:32.