-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes vanishing batch action bar when deselecting one item after selecting all elements #4353
base: 4.x
Are you sure you want to change the base?
Conversation
…cting all. Original code used a own input element to save which elements are selected. This input element was removed, so we can not determine the number of selected elements this way. The code now counts the checked checkboxes directly to determine the numbe of selected items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz just tested the PR it works great. Just need a review to remove useless code
@@ -309,21 +309,17 @@ | |||
$(document).on('change', '.form-batch-checkbox', function () { | |||
const $content = $(this).closest('.content'); | |||
let $input = $content.find(':hidden#batch_form_entityIds'); | |||
let ids = $input.val() ? $input.val().split(',') : []; | |||
const numberOfSelectedItems = $('input[type="checkbox"].form-batch-checkbox:checked').length; | |||
const id = $(this).val(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This const is now useless
…cting all. Original code used a own input element to save which elements are selected. This input element was removed, so we can not determine the number of selected elements this way. The code now counts the checked checkboxes directly to determine the numbe of selected items.
… fix_batch_action_selection
…_action_selection" This reverts commit 4f7a3f9.
Is this still valid? I don't see this problem with latest EasyAdmin 4.5.0 |
When all items were selected, and one element is unselected, the bar with the batch actions disappear, which makes it very difficult to select all but one element.
The original code by @versh23 used a own input element to save which elements are selected. This input element was removed, so we can not determine the number of selected elements this way. The code now counts the checked checkboxes directly to determine the numbe of selected items.
With this pull request the behavior is now correct.