Skip to content

[BUG] perPageSelect: false type error Type 'boolean' is not assignable to type 'number[]'. #436

@shinokada

Description

@shinokada
  • I have looked through the documentation to try to see if this behavior is documented.
  • I have looked at the demos to see if one of them handles this, but none of them did.
  • I have created a jsfiddle here: [INSERT LINK] that demonstrates the issue.

Describe the bug

  import type { DataTableOptions } from "simple-datatables";

  const dataTableOptions: DataTableOptions = {
    searchable: false,
    perPageSelect: false,
    sortable: true
  }

The above perPageSelect: false has a type error: Type 'boolean' is not assignable to type 'number[]'.ts(2322)
(property) DataTableOptions.perPageSelect?: number[] | undefined.

According to the doc, false can be used.

  1. The following ["All",-1] is from the first demo and it has a type error: Type '[string, number]' is not assignable to type 'number'.
const dataTableOptions: DataTableOptions = {
    perPageSelect: [5, 10, 15, ["All", -1]],
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions