With this setting, I’ve now noticed that the sidebar loads in the wrong position. The difference is that it is as if I have scrolled it down to the middle of the fourth sidebar item.
When I’m already on the category page and click “Categories” it loads without changing the sidebar position.
This sounds like the sidebar’s scroll position is being retained or restored incorrectly when navigating to the category page.
The fact that clicking “Categories” while already on the category page keeps the existing sidebar position suggests the issue may be related to navigation/state restoration rather than the sidebar itself.
I’d check whether the sidebar scroll container is being reused between route changes and whether its saved scroll position is being restored when the category page loads. Comparing a direct category-page load with navigation from another page should help isolate it.