Switch to a dropdown widget for ListFilter on admin

148 views
Skip to first unread message

Vasanth Mohan

unread,
Nov 3, 2022, 11:16:42 AM11/3/22
to Django developers (Contributions to Django itself)
Hello,

When there are multiple filters on a model, the filter sidebar gets cluttered quite rapidly. Is there a specfic reason, we list the options over a dropdown?

I'd like to see if there is support to change the default filter widget to dropdown? I'd like to reiterate, this merely replaces the list with a dropdown, this should not change anything at a functional level. Anything complex can continue to use third-party apps.

Thanks
Vasanth

David Sanders

unread,
Nov 4, 2022, 1:03:57 AM11/4/22
to django-d...@googlegroups.com
Hi Vasanth,

What advantages does a dropdown have over simply placing the options there though? Typically these sorts of things have horrendous accessibility and make the code more complex.

--
David 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a16ee31b-1f82-47c3-917c-56b8d3b7f892n%40googlegroups.com.

Vasanth Mohan

unread,
Nov 4, 2022, 5:02:14 AM11/4/22
to django-d...@googlegroups.com
Hi David,

While I understand the ease of use that ListFilter bring in, my issues are

1. If there are multiple filters with multiple options, the user cannot at a glance see all the filters active / available without scrolling
2.  when using multiple filters, the page is refreshed on each filter option

Potential solution;
To fix only 1 : When using the dropdown, the widget used is the same as Charfield+options. This is still a consistent design as ListFilters is built on a list of options. Moreover, since it is a standard form element, standard accessibility attributes can be used. Visually, the page can just show the filters available which is the immediate concern when looking at filters.

To fix both, (which is out of scope unless someone is interested), we can treat list filters as a part of "Search Form" with an apply button. This will allow users to select multiple filters and apply the filters with a single request.

Cordialement,
Vasanth MOHAN


You received this message because you are subscribed to a topic in the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-developers/b_nzFu4gg7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADyZw-7QTcHfsp0822DbvwpudGPxjY_ehKGvjxKifJ4_KdNUCg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages