Media Selection Modal Opens with Scroll Offset, Making File Selection Difficult

Created on 25 October 2024, 6 months ago

Problem/Motivation

When opening the media selection modal, a slight scroll offset occurs, making it harder for users to select and add media files. This behavior impacts usability, especially for users who may not notice the offset and struggle to find the media selection button.

Steps to reproduce

  1. Navigate to the admin interface.
  2. Create new content that includes a field referencing a media entity (e.g., a paragraph with a media reference field).
  3. Attempt to add a media file in the media field.
  4. Notice that the modal opens with a slight scroll offset, which can be confusing for users.

Proposed resolution

A potential workaround is to apply the following CSS rule:

.form-managed-file__main .form-element--api-file:focus {
  scroll-margin-top: 350px;
}

This adjustment will help mitigate the scroll offset issue by setting a margin that aligns the focused element correctly in the modal.

Remaining tasks

The user interface behavior will be slightly modified to ensure that the media selection modal opens without the unexpected scroll offset.

User interface changes

Test the proposed CSS change across different browsers to ensure compatibility.

🐛 Bug report
Status

Active

Component

User interface

Created by

🇫🇷France AimadBachar

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

Comments & Activities

Production build 0.71.5 2024