brandon1024 / find

A find-in-page extension for Chrome and Firefox that supports regular expressions.
https://chrome.google.com/webstore/detail/find%2B-regex-find-in-page/fddffkdncgkkdjobemgbpojjeffmmofb
GNU General Public License v3.0
409 stars 53 forks source link

Scroll to center instead of top when searching #278

Closed wolph closed 5 years ago

wolph commented 5 years ago

Fixes

Changes Proposed in this Pull Request:

Additional Comments and Documentation:

In addition to making it easier to see the context of the search result, this also fixes the issue where the popup sometimes overlaps with the search result.

This might not be something you wish to merge, it's a bit of a personal preference. It could also be a setting I guess but I personally find this method far easier.

To illustrate, before the search result is invisible (ignore the fact that I've made the search field a bit bigger):

image

After:

image

brandon1024 commented 5 years ago

Hi @WoLpH, thanks for the contribution!

I think for now, we stay with the current implementation. Right now, seeking through the occurrences on the page will keep the highlight 100px from the top of the window. In the future, I might improve on the scrolling logic to more closely follow what is done by the native find-in-page tool.

wolph commented 5 years ago

Ok, cool :)

I'll run my fork for the time being. This was bugging me for quite a while because I often search by using the history which means that after clicking it, it's not visible.

brandon1024 commented 4 years ago

Hey @WoLpH, just wanted to give a quick update, I made some improvements to the scrolling logic. It works nicer now. These changes will be available in the next release.

Cheers!

wolph commented 4 years ago

Sounds great, I'll give it a try :)