diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 9697ce86f9..a9bb50fd9d 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -50,6 +50,15 @@ rows.length ) + // Reset state when data chanegs + $: data.length, reset() + const reset = () => { + nextScrollTop = 0 + scrollTop = 0 + clearTimeout(timeout) + timeout = null + } + const getVisibleRowCount = (loaded, height, allRows, rowCount) => { if (!loaded) { return rowCount || 0 @@ -175,128 +184,129 @@ } -
-
- {editColumnTitle || ''}
-
- |
- {/if}
- {#each fields as field}
- sortBy(schema[field])}>
-
-
- {getDisplayName(schema[field])}
- {#if schema[field]?.autocolumn}
-
- {/if}
- {#if sortColumn === field}
-
- {/if}
- {#if allowEditColumns && schema[field]?.editable !== false}
-
- {/if}
- |
- {/each}
-
---|
-
-
- |
- {/if}
- {#each fields as field}
-
-
-
- |
- {/each}
+
+ ||
+
+ {editColumnTitle || ''}
+
+ |
{/if}
+ {#each fields as field}
+ sortBy(schema[field])}>
+
+
+ {getDisplayName(schema[field])}
+ {#if schema[field]?.autocolumn}
+
+ {/if}
+ {#if sortColumn === field}
+
+ {/if}
+ {#if allowEditColumns && schema[field]?.editable !== false}
+
+ {/if}
+ |
+ {/each}
---|