Skip to content

Commit

Permalink
Don't (try to) hide the reset filters button
Browse files Browse the repository at this point in the history
This lookup doesn't work because it's doing a full "class equals" check,
but the class is "btn btn-primary".

Also, because the page doesn't refresh when individual filters are
removed, if the "Reset filters" button is removed altogether then users
have no way to "apply" the removal of all filters. So we actually need
to keep this button around when the last filter is removed (it remains a
probably-weird user interaction, but I'm maintaining that for now - not
because it's good, but just to not change the existing behaviour)
  • Loading branch information
samuelhwilliams committed Sep 15, 2024
1 parent 6614753 commit f82d1d5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion flask_admin/static/admin/js/bs4_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var AdminFilters = function(element, filtersElement, filterGroups, activeFilters
$(this).closest('tr').remove();
if($('.filters tr').length == 0) {
$('button', $root).addClass('d-none');
$('a[class=btn]', $root).hide();
$('.filters tbody').remove();
} else {
$('button', $root).removeClass('d-none');
Expand Down

0 comments on commit f82d1d5

Please sign in to comment.