Describe the Bug
When a project has enough collections for the module navigation to scroll, the navigation jumps back to the top on almost every navigation. If you scroll down to reach a collection near the bottom of the list, open it, and then want to go to a neighbouring collection, the list has already scrolled back to the top and you have to scroll down again.
The module navigation's scroll container lives inside PrivateView, which each route component mounts itself (app/src/modules/content/routes/collection.vue, item.vue, …). Any navigation that swaps the route component therefore destroys the scroll container and creates a new one at scrollTop: 0, and nothing persists the offset.
That means the reset happens on every navigation between different route records, not just within Content:
| Navigation |
Nav scroll offset |
| collection list → another collection list (same route record) |
preserved |
| collection list → item detail |
reset to 0 |
| item detail → another collection |
reset to 0 |
| Content → Settings → Content |
reset to 0 |
To Reproduce
- Create enough collections that the module navigation scrolls (25 collections at a 1440×640 viewport is enough).
- Go to Content and open the first collection.
- Scroll the module navigation to the bottom.
- Open any item in the collection (or click a collection while an item detail page is open).
- The module navigation is back at the top.
Measured with Playwright against directus/directus:12.3.1, reading #module-navigation scrollTop before and after each navigation:
OK | collection list -> other collection: 310 -> 310
RESET | item detail -> other collection: 310 -> 0
RESET | collection list -> item detail (row click): 310 -> 0
RESET | module switch: content -> settings -> content: 310 -> 0
OK | browser back after navigating away: 310 -> 310
Directus Version
v12.3.1
Hosting Strategy
Self-Hosted (Docker Image)
Database
SQLite 3
Describe the Bug
When a project has enough collections for the module navigation to scroll, the navigation jumps back to the top on almost every navigation. If you scroll down to reach a collection near the bottom of the list, open it, and then want to go to a neighbouring collection, the list has already scrolled back to the top and you have to scroll down again.
The module navigation's scroll container lives inside
PrivateView, which each route component mounts itself (app/src/modules/content/routes/collection.vue,item.vue, …). Any navigation that swaps the route component therefore destroys the scroll container and creates a new one atscrollTop: 0, and nothing persists the offset.That means the reset happens on every navigation between different route records, not just within Content:
To Reproduce
Measured with Playwright against
directus/directus:12.3.1, reading#module-navigationscrollTopbefore and after each navigation:Directus Version
v12.3.1
Hosting Strategy
Self-Hosted (Docker Image)
Database
SQLite 3