Making WordPress.org

Opened 3 years ago

Closed 20 months ago

#5867 closed defect (bug) (worksforme)

Anchor links headline invisible behind top menu bar. Should have compensating offset.

Reported by: abitofmind's profile abitofmind Owned by:
Milestone: Priority: lowest
Component: WordPress.org Site Keywords:
Cc:

Description

Otherwise when jumplink to the target of an anchor link by TOC or direct deep link the arriving user does not see the heading and may be disoriented or not get the context at first.

There are even ready made WordPress plugins to do this like i.e.:
https://wordpress.org/plugins/page-scroll-to-id/
and I assume also some themes have such offset-compensation-mechanisms built in.

See screenshots of the problem and the proposed solution:
https://www.dropbox.com/s/0wysnpu87ponqfa/
https://www.dropbox.com/s/wjiy9ku1yctyc0y/
https://www.dropbox.com/s/n5cmp39ll6da5vn/
https://www.dropbox.com/s/57jqquvdvuvxg9x/

Change History (16)

#1 @jonoaldersonwp
3 years ago

  • Priority changed from normal to lowest

This can be solved with some simple CSS; see scroll-margin-top

#2 @abitofmind
3 years ago

Didn't know about this CSS attribute! Great.

Followup:

  • I'm merely the reporter, not an active part of a WP team.
  • Are there plans to improve this? In the default theme? Or in the WordPress.org instance?

#3 @jonoaldersonwp
3 years ago

All open tickets get reviewed and triaged, though resource is short, and this is likely to be of low priority. Should be an easy fix, though, so hopefully, it'll land on wordpress.org without taking years...

#4 @abitofmind
3 years ago

Thanks for informing us here about the team workflow.
It's a quick win — quite a usability gain achievable with not too much effort — so that again should prioritize it higher, I hope.

Anyway sharing CSS scroll-margin-top is a good hint for individual CSS workarounds for many blogs/themes out there who may arrive here via a search engine. Thanks!

This ticket was mentioned in Slack in #forums by abitofmind. View the logs.


3 years ago

#6 @abitofmind
3 years ago

The deficiency outlined in this very issue also manifests itself in this/these issue(s):

  • #5877 (among other issues)

#7 @abitofmind
3 years ago

Found plugin Fixed Menu Anchor which deals with the symptom. It was last updated circa 2016.

As CSS attribute scroll-margin-top got major browser support only ca. 2018-2020, I assume that plugin involves some Javascript. A pure native CSS surely works smoother. But maybe a workaround for some in the meantime.

#8 @abitofmind
20 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

✅ Marking this as fixed:

  • WP.org Documentation Section + Support Forums
  • They both have proper offset compensation for jumplinks (anchor links) as of today. See screen recordings below.
  • I do not know by what technique this was achieved. If some one knows it would be nice to document/link here.
Note: See TracTickets for help on using tickets.