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

WIP: Fix example text popup not updating correctly when scan resolution is set to word #1527

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

Conversation

jamesmaa
Copy link
Collaborator

WIP for #1526

Currently able to repro in a test case. So far what I can observe:

<div class="example-text-container">
                <input type="text" class="example-text example-text-input" id="example-text-input" hidden="" lang="en">
                <span class="example-text" id="example-text">read</span>
            </div>

The textSource range starts on the Text node of "read" with offset 0. We then try to set the startOffset of the textSource back to find the beginning of the word (trying to find the word boundary). Since the starting point is the Text node at offset 0, it basically exits the span class and starts to read the text node between the input and the span elements, consisting of a Text node with values \n . Then the DOMTextScanner hits the space that it considers a word boundary and then stops there, returning a range that starts at the Text node with "\n " when I think it should basically stop where it started.

Still unsure why this bug is not triggered with normal text scanning at the beginning of a word

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