diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index f634f913c9..9697ce86f9 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -82,11 +82,14 @@ }) } - const sortBy = field => { - if (field === sortColumn) { + const sortBy = fieldSchema => { + if (fieldSchema.sortable === false) { + return + } + if (fieldSchema.name === sortColumn) { sortOrder = sortOrder === "Descending" ? "Ascending" : "Descending" } else { - sortColumn = field + sortColumn = fieldSchema.name sortOrder = "Descending" } } @@ -145,7 +148,7 @@ const calculateLastVisibleRow = (firstRow, visibleRowCount, allRowCount) => { if (visibleRowCount === 0) { - return firstRow + return -1 } return Math.min(firstRow + visibleRowCount + 2 * rowPreload, allRowCount) } @@ -195,10 +198,11 @@ {/if} {#each fields as field}