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

Find resets editor position upon closing #82

Open
videosmith opened this issue Aug 19, 2021 · 4 comments
Open

Find resets editor position upon closing #82

videosmith opened this issue Aug 19, 2021 · 4 comments
Labels
Milestone

Comments

@videosmith
Copy link

When I click on the magnifying glass and search for text, the script updates to the selected text location, however when you close the the Find tool, the script resets to the top. Is there a way to maintain the script position after the Find tool is closed?

@Cuperino Cuperino added the bug label Aug 19, 2021
@Cuperino Cuperino added this to the 2.5 milestone Aug 19, 2021
@Cuperino
Copy link
Collaborator

Bug confirmed, this should be fixed for 2.5.

@videosmith, thank you for all the feedback. I found a quick workaround that should help you for now. The text found continues to be selected after the scroll jumps back to the start. This means you can go back to the found location by pressing the left or right arrow keys after closing the find tool.

@videosmith
Copy link
Author

Thank you. That helps.

FYI, I attempted to search for a few numbers on your sample script, received a 'specified text was not found' error - may not be able to locate numbered bullet points.

Curiously, '5' was able to be located by the Find tool - possibly related to aq nearby Anchor attached?

@Cuperino
Copy link
Collaborator

Cuperino commented Aug 19, 2021

That curiosity is due to a property of HTML, which we can do nothing about. Lists can be ordered (numbered) or unordered (bullets). Ordered lists have their numbers added automatically by the browser and do not appear in search results, because the numbers are not a part of the document object model (DOM) being searched.

When searching for 5, you're actually being shown the 5 from "Try pressing '5' now!", which is currently located at the 6th element of the list, thus giving the impression that Find takes you to list element number 5, but in reality it's showing element number 6, because search results are shown at the bottom of the page.

Ordered lists are useful to prevent numbering errors when adding or removing elements. Unfortunately, they can't be searched for without having direct control over the browser's DOM parser (which is not possible on Imaginary Teleprompter) or using two separate DOM parsers and models with expensive to write, inefficient to run, and hard to maintain source code to keep them in sync.

@Cuperino Cuperino changed the title Find text tool Find Resets Editor Position Upon Closing Aug 19, 2021
@videosmith
Copy link
Author

videosmith commented Aug 19, 2021 via email

@Cuperino Cuperino changed the title Find Resets Editor Position Upon Closing Find resets editor position upon closing Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants