Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#43452 closed defect (bug) (duplicate)

Toolbar: Target for page-jump links hidden behind admin bar after a jump

Reported by: kokkieh's profile kokkieh Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Toolbar Keywords:
Focuses: Cc:

Description (last modified by designsimply)

Page jump links cause the target text to be hidden behind the admin bar for logged in users after clicking on the page jump link.

To replicate

  1. Create a new post/page
  2. Add some text, at least a couple pages
  3. Add an id attribute to some text that appear below the fold
  4. Add a link at the top targeting the id

(Alternatively, add some footnotes throughout the text)

  1. Publish the post, view, and click the link

What I expected

That the footnote/text with the id attribute will appear at the top of my browser, as it does when logged out:

https://cldup.com/X_8HBiRbPd.gif

What happened instead?

The next line below the targeted text appeared at the top of my browser, as the targeted line itself was behind the admin bar:

https://cldup.com/N0GhD2Gj63.gif

If the target id-attribute is added to a heading this is less noticeable - logged out there's some space between the top of the browser and the heading after the jump, but logged in the heading is flush against the admin bar. It looks like the padding-top value used on headings mitigates the effect. That padding is absent if the jump target is inline text or a footnote.

This behavior can also be observed with Continue Reading links in posts.

Possibly similar to #22520, found by @designsimply

Change History (7)

#1 follow-up: @kokkieh
7 years ago

Seems I cannot attach animated GIFs illustrating the issue. Uploaded them here instead.

#2 @designsimply
7 years ago

  • Description modified (diff)

#3 in reply to: ↑ 1 ; follow-up: @designsimply
7 years ago

Replying to kokkieh:

Seems I cannot attach animated GIFs illustrating the issue. Uploaded them here instead.

Fixed the refs in the ticket by using the full url, such as https://cldup.com/X_8HBiRbPd.gif

#4 in reply to: ↑ 3 @kokkieh
7 years ago

Replying to designsimply:

Fixed the refs in the ticket by using the full url, such as https://cldup.com/X_8HBiRbPd.gif

Thank you!

#5 @pento
6 years ago

  • Version trunk deleted

#6 @sabernhardt
4 years ago

Further discussion about this issue is on #46371, and #51910 has a patch with scroll-padding-top

#7 @sabernhardt
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I added parts of the description to #46371 so future discussion can stay on one ticket.

Note: See TracTickets for help on using tickets.