Give focus on the element after scrolling to it

Created on 31 March 2022, over 2 years ago
Updated 30 August 2024, 4 months ago

Problem/Motivation

Give focus on the element after scroling to it. This allows to be RGAA compliant. We must give the focus on the element targeted once we have scrolled to it.

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇫🇷France flocondetoile Lyon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇮Finland Aelfendir

    You should be able to work around this issue by disabling the "Smooth scrolling" setting.

    If you want to retain the smooth scrolling effect, you could apply that with CSS:

    @media (prefers-reduced-motion: no-preference) {
      html {
        scroll-behavior: smooth;
      }
    }
  • 🇫🇷France mably

    Just released the ToC NG module which is a fork of this module (ToC.js).

    This module was developed as a proof-of-concept for our own needs. We decided to share it with the community.

    There is a new option allowing to set the focus on the targeted heading after scroll:

  • 🇫🇷France mably

    FYI it has been fixed in the new 3.0.x-dev version.

  • Status changed to Fixed 4 months ago
  • 🇫🇷France flocondetoile Lyon

    @mably feel free to close issues if necessary :-)

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024