Page scrolls to top after inserting media via Linkit Media Library

Created on 1 February 2025, 3 months ago

Problem/Motivation

After selecting and inserting media through the "Linkit media library" interface, the page unexpectedly scrolls to the top. This behavior disrupts the user experience, especially on longer pages, as users lose their place and must manually scroll back to continue editing.

Steps to reproduce

  1. Install a clean Drupal environment (version 11.1.0) using simplytest.me.
  2. Install Linkit and Linkit media library modules
  3. Configure the "Linkit" module within a text format.
  4. Navigate to a content creation page where the configured text format is applied.
  5. Ensure the page is sufficiently long so that the CKEditor field is near the bottom, making the scrolling effect noticeable.
  6. In the CKEditor toolbar, click the "Link" icon, then select "Media library."
  7. Choose an existing media item and click "Insert selected."

Observed Result: Upon insertion, the page scrolls to the top instead of focusing on the "Link URL" input field.

🐛 Bug report
Status

Active

Version

2.0

Component

User interface

Created by

🇷🇺Russia qzmenko Novosibirsk

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

Comments & Activities

  • Issue created by @qzmenko
  • 🇷🇺Russia qzmenko Novosibirsk

    I am attaching a video demonstrating the issue. As shown in the video, after selecting and inserting media using the Linkit Media Library, the page scrolls to the top instead of keeping focus on the "Link URL" input field.

Production build 0.71.5 2024