Skip to content
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

Open
wants to merge 5 commits into
base: 4.x
Choose a base branch
from

Conversation

jbtronics
Copy link
Contributor

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.

…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.
Copy link
Contributor

@gaelb80 gaelb80 left a 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();
Copy link
Contributor

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

jbtronics added 4 commits May 31, 2021 15:13
…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.
@mahono
Copy link

mahono commented Dec 21, 2022

Is this still valid? I don't see this problem with latest EasyAdmin 4.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants