Skip to content

fix: footer-row lifecycle - construction crash, inconsistent getFooterRow, double onFooterRowCellRendered - #2672

Merged
ghiscoding merged 1 commit into
masterfrom
bugfix/footer-lifecycle
Aug 3, 2026
Merged

fix: footer-row lifecycle - construction crash, inconsistent getFooterRow, double onFooterRowCellRendered#2672
ghiscoding merged 1 commit into
masterfrom
bugfix/footer-lifecycle

Conversation

@ghiscoding

Copy link
Copy Markdown
Owner

Port bug fix from 6pac/SlickGrid PR 6pac/SlickGrid#1256 into slickgrid-universal

Three related footer-row lifecycle bugs, fixed together because they share the same code area and would conflict as separate PRs.

1. showFooterRow without createFooterRow crashes at construction

getViewportHeight()'s footer term was gated on showFooterRow alone and dereferenced the undefined _footerRowScroller[0]:

// before (crashes when createFooterRow is false)
this.footerRowH = (this._options.showFooterRow) ? this._options.footerRowHeight! + this.getVBoxDelta(this._footerRowScroller[0]) : 0;

The header-row and top-header terms in the same function already use the create && show idiom. Both footer sites (regular and autoHeight paths) now match:

this.footerRowH = (this._options.createFooterRow && this._options.showFooterRow) ?  : 0;

Repro: new Slick.Grid('#c', data, cols, { showFooterRow: true }) → TypeError at init.

2. getFooterRow() fails inconsistently without a footer

Without createFooterRow, the non-frozen path threw (_footerRow[0] of undefined) while the frozen path returned undefined — identical misuse, two different failure modes. Now returns undefined consistently (one optional chain).

Repro: grid.getFooterRow() on a footer-less grid → TypeError (non-frozen) vs undefined (frozen).

3. onFooterRowCellRendered fired twice per column; stale right-footer cells after un-freezing

createColumnHeaders() contained a duplicated footer destroy pass and a duplicated footer-cell creation block — but createColumnFooter() is called immediately after createColumnHeaders() at both call sites and does the complete job correctly. Consequences of the duplication:

  • onFooterRowCellRendered fired twice per visible column on every setColumns() (once from each function), and footer cells were built twice.
  • The duplicate destroy pass gated its right side on hasFrozenColumns() rather than element existence, so after un-freezing (frozenColumn: -1) the right footer kept stale cells.

The duplicated blocks are deleted; createColumnFooter() is the single owner of footer cell lifecycle. (Its destroy pass also fires the event with node: column — the actual cell — rather than the duplicate's node: this.)

Repro: subscribe to onFooterRowCellRendered, call grid.setColumns(grid.getColumns()) → handler fired 2× per column.

Test

cypress/e2e/quirk-footer-lifecycle.cy.ts — a three-grid repro page with in-page self-checks (construct-without-crash, undefined contract, exactly-one-fire-per-column). Verified to fail on the pre-fix code and pass with the fixes. Also ran the frozen/example regression suites (31/31 green) since the fix touches createColumnHeaders.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (15d9833) to head (e7fb28c).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2672   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         200      200           
  Lines       25452    25435   -17     
  Branches     8999     8993    -6     
=======================================
- Hits        25452    25435   -17     
Flag Coverage Δ
angular 100.0% <ø> (ø)
universal 100.0% <100.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown
angular-slickgrid

npm i https://pkg.pr.new/angular-slickgrid@2672

aurelia-slickgrid

npm i https://pkg.pr.new/aurelia-slickgrid@2672

slickgrid-react

npm i https://pkg.pr.new/slickgrid-react@2672

slickgrid-vue

npm i https://pkg.pr.new/slickgrid-vue@2672

@slickgrid-universal/angular-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/angular-row-detail-plugin@2672

@slickgrid-universal/aurelia-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/aurelia-row-detail-plugin@2672

@slickgrid-universal/react-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/react-row-detail-plugin@2672

@slickgrid-universal/vue-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/vue-row-detail-plugin@2672

@slickgrid-universal/binding

npm i https://pkg.pr.new/@slickgrid-universal/binding@2672

@slickgrid-universal/common

npm i https://pkg.pr.new/@slickgrid-universal/common@2672

@slickgrid-universal/composite-editor-component

npm i https://pkg.pr.new/@slickgrid-universal/composite-editor-component@2672

@slickgrid-universal/custom-footer-component

npm i https://pkg.pr.new/@slickgrid-universal/custom-footer-component@2672

@slickgrid-universal/custom-tooltip-plugin

npm i https://pkg.pr.new/@slickgrid-universal/custom-tooltip-plugin@2672

@slickgrid-universal/empty-warning-component

npm i https://pkg.pr.new/@slickgrid-universal/empty-warning-component@2672

@slickgrid-universal/event-pub-sub

npm i https://pkg.pr.new/@slickgrid-universal/event-pub-sub@2672

@slickgrid-universal/excel-export

npm i https://pkg.pr.new/@slickgrid-universal/excel-export@2672

@slickgrid-universal/graphql

npm i https://pkg.pr.new/@slickgrid-universal/graphql@2672

@slickgrid-universal/odata

npm i https://pkg.pr.new/@slickgrid-universal/odata@2672

@slickgrid-universal/pagination-component

npm i https://pkg.pr.new/@slickgrid-universal/pagination-component@2672

@slickgrid-universal/pdf-export

npm i https://pkg.pr.new/@slickgrid-universal/pdf-export@2672

@slickgrid-universal/row-detail-view-plugin

npm i https://pkg.pr.new/@slickgrid-universal/row-detail-view-plugin@2672

@slickgrid-universal/rxjs-observable

npm i https://pkg.pr.new/@slickgrid-universal/rxjs-observable@2672

@slickgrid-universal/sql

npm i https://pkg.pr.new/@slickgrid-universal/sql@2672

@slickgrid-universal/text-export

npm i https://pkg.pr.new/@slickgrid-universal/text-export@2672

@slickgrid-universal/utils

npm i https://pkg.pr.new/@slickgrid-universal/utils@2672

@slickgrid-universal/vanilla-bundle

npm i https://pkg.pr.new/@slickgrid-universal/vanilla-bundle@2672

@slickgrid-universal/vanilla-force-bundle

npm i https://pkg.pr.new/@slickgrid-universal/vanilla-force-bundle@2672

@slickgrid-universal/web-mcp

npm i https://pkg.pr.new/@slickgrid-universal/web-mcp@2672

commit: e7fb28c

@ghiscoding ghiscoding added the AI label Jul 29, 2026
@ghiscoding
ghiscoding merged commit 1dddad1 into master Aug 3, 2026
13 checks passed
@ghiscoding
ghiscoding deleted the bugfix/footer-lifecycle branch August 3, 2026 16:33
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🎉 This pull request is included in version 10.9.0 📦
🔗 The release notes are available at: GitHub Release 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant