Skip to content

Fix invalid empty-state range in getShowingInfo() - #21

Merged
RA9 merged 3 commits into
masterfrom
copilot/fix-empty-state-range
Jul 18, 2026
Merged

Fix invalid empty-state range in getShowingInfo()#21
RA9 merged 3 commits into
masterfrom
copilot/fix-empty-state-range

Conversation

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

getShowingInfo() always computed startIndex = 1, producing "Showing 1 to 0 of 0 items" when data was empty. The fix returns "No items to show" early when totalItems === 0, before any index arithmetic runs.

Changes

  • src/index.ts: In getShowingInfo(), short-circuit with "No items to show" when totalItems === 0 — applies to both normal and filtered data modes.
  • src/__tests__/index.test.ts: New test covering the empty-data case.
const table = new EzyTables({ clientEnabled: true, data: [], renderFunction: () => {} });
table.getShowingInfo(); // Previously: "Showing 1 to 0 of 0 items ."
                        // Now:        "No items to show"

Copilot AI assigned Copilot and RA9 Jul 18, 2026
Copilot AI linked an issue Jul 18, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix invalid empty-state range in getShowingInfo Fix invalid empty-state range in getShowingInfo() Jul 18, 2026
Copilot finished work on behalf of RA9 July 18, 2026 11:19
Copilot AI requested a review from RA9 July 18, 2026 11:19
@RA9
RA9 marked this pull request as ready for review July 18, 2026 13:03
@RA9
RA9 merged commit 7933234 into master Jul 18, 2026
4 checks passed
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.

Fix invalid empty-state range in getShowingInfo()

2 participants