Skip to content

Commit

Permalink
Fix reset button by the query box not working
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Mar 19, 2022
1 parent b8daa76 commit 4a583e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions spec/integration/actions/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
end
end

it 'allows to clear the search query box', js: true do
visit index_path(model_name: 'player', query: @players[0].name)
is_expected.not_to have_content(@players[1].name)
find_button('Reset filters').click
is_expected.to have_content(@players[1].name)
end

it 'allows to filter on one attribute' do
RailsAdmin.config Player do
list do
Expand Down
2 changes: 1 addition & 1 deletion src/rails_admin/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ import I18n from "./i18n";
event.preventDefault();
$("#filters_box").html("");
$("hr.filters_box").hide();
$(this).parent().siblings("input[type='search']").val("");
$(this).siblings("input[type='search']").val("");
$(this).parents("form").submit();
});

Expand Down

0 comments on commit 4a583e9

Please sign in to comment.