Modernize Drupal.ajaxCommands.scrollTop()

Created on 1 October 2024, about 2 months ago

Problem/Motivation

The scrollTop() AJAX command calls the native scrollTo() method with a hard-coded offset of 10px.

If we would call scrollIntoView() (spec) instead, sites that are using a fixed header could define a scroll offset through CSS, which avoids the element to be scrolled below the header, e.g. like this for views:

[data-once="ajax-pager"] {
  scroll-margin-top: 5rem;
}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

ajax system

Created by

🇩🇪Germany mrshowerman Munich

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024