craftcms / craftcms/cms

[5.x]: FLD library HUD affects page scroll position when it opens

Open
#16,549 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

The new FLD library HUD in 5.6 is great, but has an annoying behaviour where it sometimes changes the page's scroll position when it opens – sometimes to such a degree that the active tab is scrolled completely out of view.

This doesn't occur consistently, but often enough that it's disorienting and a bit annoying.

Unfortunately I've been unable to figure out exactly the circumstances that triggers this, so I'm unable to provide clear steps to reproduce this one. Here's a video to demonstrate the issue:

https://github.com/user-attachments/assets/328a3e73-5b1d-4f48-9dde-b04c3952cfcf

Steps to reproduce
  1. Have a lot of fields (the height of the FLD HUD feels relevant), and a modestly sized viewport
  2. Crack open a field layout designer and click the "Add" button in a tab
Expected behavior

The page scroll position shouldn't change when opening the HUD.

Actual behavior

The page scroll position often changes a lot.

Craft CMS version

5.6.1

PHP version

No response

Operating system and version

macOS 14.6.1, MS Edge 131.0.2903.112

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

A few, but I'm able to reproduce the issue with all installed plugins disabled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the FLD library HUD and the Add button in a field layout designer; begin by reproducing it with many fields in a modest viewport. Compare the page scroll position before and after opening the HUD, and verify that opening it leaves the active tab in view without changing the page position.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.