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

Fix: Incorrectly hiding the 'Select all X' table link #12853

Conversation

dev-idkwhoami
Copy link
Contributor

Description

This PR is related to issue #12781.

The "Select all X" link was hidden by comparing the amount of selected records with the "selectable" records on the page.
But since records stay selected across pages this caused the undesired behavior.

The code change instead checks if the current pages records all are part of the selected records.

Visual changes

Before recording can be found in the issue.

image

There are a total of 5 selected records matching the pages record count but the link is still shown.
That was previously not possible.

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

Due to the amount of selected records matching across multiple pages while 'selectCurrentPageOnly()' is set.
@bzy107
Copy link
Contributor

bzy107 commented May 19, 2024

Thank you for fixing my bug report.
However, I think it's necessary to add a condition to handle cases where selectCurrentPageOnly is not used.

Here is a video showing the case where selectCurrentPageOnly is not used:

2024-05-19.15.01.10.mov

@dev-idkwhoami
Copy link
Contributor Author

There is another issue.
When switching pages it doesn't refresh so when u go from a page where it should not be visible to a page where it should it stays hidden and the other way around as well.

@danharrin danharrin linked an issue May 20, 2024 that may be closed by this pull request
@danharrin danharrin added the bug Something isn't working label May 20, 2024
@danharrin danharrin added this to the v3 milestone May 20, 2024
@danharrin
Copy link
Member

I've changed it so instead of a random string that refreshes on every request, it will only refresh when the page is changed

@danharrin
Copy link
Member

Can you test that it still works and let me know please?

@danharrin danharrin self-assigned this May 20, 2024
@dev-idkwhoami
Copy link
Contributor Author

I pulled the changes you made couldn't find any change in behavior 👍

brave_O9WtiiY1eK

@danharrin danharrin merged commit 29add93 into filamentphp:3.x May 20, 2024
10 checks passed
@danharrin
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

The behavior when using selectCurrentPageOnly
3 participants