django-unfold icon indicating copy to clipboard operation
django-unfold copied to clipboard

Sidebar Scroll to "current-app" or "current-model"

Open cleor41 opened this issue 1 year ago • 3 comments

When clicking through the apps/models in the side nav, the page will refresh on each click and you lose your spot in the side nav. This is a minor inconvenience but one you notice if you have a lot of apps/models and just want to focus on the current app. You'll have to scroll down the side nav to get back your context.

I created a simple script that starts the side navbar navigation from the current app and included it into unfold template. (i.e. grab "nav .current-app" element and then call "scrollIntoView"). This feature might be useful for everyone though. Would something like this be supported by default?

cleor41 avatar Feb 11 '24 14:02 cleor41

@cleor41 I'm not sure if I undertstand the issue correctly. Would you mind to create a video where it is possible to see the problem?

lukasvinclav avatar Mar 08 '24 10:03 lukasvinclav

Something like this

https://github.com/unfoldadmin/django-unfold/assets/6909067/da7c763c-e63c-4473-93b8-f360632bcb82

Because of the page reload on click - if you have a lot of elements in the sidebar then you'll lose your place in the sidebar.

cleor41 avatar Mar 14 '24 19:03 cleor41

Do we want to add this or should we close this issue?

cleor41 avatar Apr 28 '24 03:04 cleor41