vincjo / datatables

A toolkit for creating datatable components with Svelte
https://vincjo.fr/datatables
MIT License
372 stars 15 forks source link

Pagination breaks after rows per page change #11

Closed DVDAndroid closed 1 year ago

DVDAndroid commented 1 year ago
  1. Go to https://vincjo.fr/datatables/tutorial/pagination example
  2. Select page 9
  3. Change value of number entries to 100
  4. Result: empty table, incorrect page selected

Possible fixes or workarounds:

vincjo commented 1 year ago

Indeed, thx maybe a setRowsPerPage method is missing. This would allow the event to be handled automatically. In the meantime I added on:change in select element :

    <select bind:value={$rowsPerPage} on:change={() => handler.setPage(1)}>
        {#each options as option}
            <option value={option}>
                {option}
            </option>
        {/each}
    </select>