Skip to content

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

Description

@RA9

Description

When _data is empty, getShowingInfo() computes startIndex = 1 and endIndex = min(1 + perPage - 1, 0) = 0, producing the nonsensical string "Showing 1 to 0 of 0 items".

Steps to reproduce

const table = new EzyTables({ clientEnabled: true, data: [], ... });
console.log(table.getShowingInfo()); // "Showing 1 to 0 of 0 items ."

Expected behavior

Return "No items to show" (or equivalent) when totalItems === 0.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions