#4187 Line number anchor links not working
Closed: Fixed a year ago by pingou. Opened 2 years ago by churchyard.

I have Chromium. When I head to e.g. https://pagure.io/releng/blob/master/f/scripts/distgit/utilities.py and i click a line number, the line is highlited, the URL changes to https://pagure.io/releng/blob/master/f/scripts/distgit/utilities.py#_19 and the view in my browser scrolls to that line.

However when I visit https://pagure.io/releng/blob/master/f/scripts/distgit/utilities.py#_19 directly the line is not highlighted and the browser doesn't scroll.


Metadata Update from @pingou:
- Issue tagged with: JS, bug

2 years ago

In firefox it seems the scroll happens but not the highlight :(

It doesn't work for me either.

Metadata Update from @jlanda:
- Issue assigned to jlanda

2 years ago

Metadata Update from @jlanda:
- Issue set to the milestone: 5.7

2 years ago

In Chromium on first try, the line is highlighted, but page is scrolled to a wrong place - it scrolls to the line before all the fancy css and fonts load and later is not rescrolled when that happens.

On second (presumably cached) load, it scrolls to that line immediately and than jumps a little above. The jump seems a bit disruptive, yes still better than current situation. Would you like a video?

I used scrollIntoView() but it seems that it support is not the best one. I'll have to go on old way of doing this and scroll calculating distances :(

Thank You! Scroll and highlight both work in Chromium.

As a side note: Is the "smooth" scroll to the line intentional for effect or necessary to make it work? If intentional, consider not to do it, it's IMHO quite disturbing to watch. (But not a big deal if it is necessary, consider this issue fixed.)

I don't think is really needed, I'll try eith smooth:false

The real trick is on the timeout delay, otherwise the navigator does not have enough time to convert the code on a html table and fails computing the real scrolling distance

Metadata Update from @pingou:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

a year ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #4583 Merged a year ago
  • #4518 Merged 2 years ago