Skip to content

Conversation

@waqas2714
Copy link

Fix preset list scrolling behaviour on category expand

Fixes: #11762

Description

This PR resolves an issue where expanding a category in the preset list did not scroll newly revealed child items into view. This could be confusing, as it was not immediately clear that additional presets had appeared.

With this change:

  • When a category expands, the first visible child presets are automatically scrolled into view within .inspector-body.
  • This provides immediate visual feedback that the expansion action succeeded.
  • Improves usability when interacting with long or deeply nested preset lists.

Implementation

  • Detects the expanded .subgrid element after layout has completed.
  • Checks whether child preset items fall outside the visible viewport of .inspector-body.
  • Scrolls the first relevant child item(s) into view when necessary.
  • Uses requestAnimationFrame to ensure DOM measurements occur after expansion.
  • Uses scrollIntoView({ block: 'nearest' }) to avoid excessive or jarring scroll jumps.

How to test

  1. Open the preset inspector for an area with nested presets (e.g. Natural Features).
  2. Scroll near the bottom of the preset list.
  3. Expand a category.
  4. Verify that the first newly revealed child preset(s) are automatically scrolled into view.

Demo

v-sub

Checklist

  • Tested manually in supported browsers
  • No regressions introduced in inspector navigation
  • Code follows project style guidelines

@k-yle k-yle linked an issue Jan 22, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menus should jump up when clicked

1 participant