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 in page doesn't work in Safari #420

Open
lilyball opened this issue Nov 4, 2016 · 4 comments
Open

Find in page doesn't work in Safari #420

lilyball opened this issue Nov 4, 2016 · 4 comments

Comments

@lilyball
Copy link

lilyball commented Nov 4, 2016

Using the browser's built-in Find functionality doesn't work in Safari. It finds results, but doesn't actually scroll to them or highlight them. Instead it just scrolls to the top.

IIRC I have occasionally seen it work, but I'm not actually confident about that. If true, it's rare enough that I just stopped even trying to search because, in general, it doesn't work.

Reproduced with Safari 10.0.1 on macOS 10.12, though this was also a problem with Safari 9 on macOS 10.11.

@lilyball
Copy link
Author

lilyball commented Nov 4, 2016

Huh, before filing this I tried it in Chrome and it worked. But I just re-opened the same review in Chrome, and now Find is broken there too.

Edit: Ok, even weirder. I deleted my find string and re-typed it, and now it's working again (in Chrome). But asking Chrome to Find Again with the original string (which is identical to the new one) didn't work. I wonder if this is a Chrome bug where it cached the lack of results from before the diff loaded.

@pkaminski
Copy link
Member

I haven't been able to quite reproduce this, and specifically don't see a difference in behavior between Safari and Chrome. The closest I got is that matches are found in "older comments" that are currently hidden because I keep the DOM around but not visible. This can look strange since the browser shows (Safari) or tries to show (Chrome) a match on something that isn't visible.

Does that explain the behavior you're observing or is it something else?

@lilyball
Copy link
Author

lilyball commented Nov 5, 2016

Testing again right now in Safari, I search for a string that should show up 9 times. Safari correctly identifies 9 results. And it actually does highlight them, but it scrolls to a fixed position and doesn't update the scroll when trying to jump between the matches. Normally that fixed position is at the top of the page, though when testing right now on my open review it's jumping to somewhere near the end of the page instead.

The fact that it's not scrolling correctly even though it's highlighting the correct rects suggests it's a Safari bug, but I've never seen this issue on any other website.

@pkaminski
Copy link
Member

OK, here's what I reproduced in Safari on the demo review:

  • searching for here works; all the matches are in comments
  • searching for hour kinda works; it shows a white highlight around the matches in the code and jumps around
  • searching for illegal doesn't work; no highlights, and the page jumps to the wrong spot

So it seems like Safari has a problem with searching through the code. I wonder if it's getting thrown off by the user-select: none?

I haven't been able to reproduce any issue in Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants