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(common): Select All checkbox shouldn't disappear w/Dark Mode toggle #1421

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Mar 7, 2024

  • when using Row Selections grid option, the Select All checkbox was disappearing after toggling Dark Mode, that was caused by the fact that calling grid.setOptions() is recreating the header columns and the Select All itself is not being recreated
  • also the same issue happened whenever reordering a column to another position because again it called the grid set columns and that again rerendered all column headers without the Select All
  • to fix both issue, I added a new onAfterSetColumns SlickEvent which we subscribe to inside the SlickCheckboxSelectColumn plugin, and whenever triggered, we reevaluate the Select All which in term recreates it

below are the 2 problems identified that were fixed by this PR

brave_hYRDIxVdpU
brave_ynYb7ao5e3

- when using Row Selections grid option, the Select All checkbox was disappearing after toggling Dark Mode, that was caused by the fact that calling `grid.setOptions()` is recreating the header columns and the Select All itself is not being recreated
- also the same issue happened whenever reordering a column to another position because again it called the grid set columns and that again rerendered all column headers without the Select All
- to fix both issue, I added a new `onAfterSetColumns` SlickEvent which we subscribe to inside the SlickCheckboxSelectColumn plugin, and whenever triggered, we reevaluate the Select All which in term recreates it
Copy link

stackblitz bot commented Mar 7, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.8%. Comparing base (9f540b2) to head (731e0b0).

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1421     +/-   ##
========================================
+ Coverage    99.8%   99.8%   +0.1%     
========================================
  Files         199     199             
  Lines       21607   21611      +4     
  Branches     7228    6961    -267     
========================================
+ Hits        21543   21547      +4     
- Misses         58      64      +6     
+ Partials        6       0      -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ghiscoding ghiscoding merged commit 5fab179 into master Mar 7, 2024
9 checks passed
@ghiscoding ghiscoding deleted the bugfix/recreate-header-checkbox-select-all branch March 7, 2024 05:58
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.

1 participant