Remount table when columns change to avoid rare crashes

This commit is contained in:
Andrew Kingston 2022-11-23 12:32:20 +00:00
parent c01b9af1f0
commit 42d2a71395
1 changed files with 139 additions and 137 deletions

View File

@ -270,13 +270,14 @@
}
</script>
<div
{#key fields?.length}
<div
class="wrapper"
class:wrapper--quiet={quiet}
class:wrapper--compact={compact}
bind:offsetHeight={height}
style={`--row-height: ${rowHeight}px; --header-height: ${headerHeight}px;`}
>
>
{#if !loaded}
<div class="loading" style={heightStyle}>
<ProgressCircle />
@ -306,8 +307,8 @@
class:noBorderHeader={!showHeaderBorder}
class:spectrum-Table-headCell--alignCenter={schema[field]
.align === "Center"}
class:spectrum-Table-headCell--alignRight={schema[field].align ===
"Right"}
class:spectrum-Table-headCell--alignRight={schema[field]
.align === "Right"}
class:is-sortable={schema[field].sortable !== false}
class:is-sorted-desc={sortColumn === field &&
sortOrder === "Descending"}
@ -418,7 +419,8 @@
{/if}
</div>
{/if}
</div>
</div>
{/key}
<style>
/* Wrapper */