Fix grid block having incorrect toolbar position in builder preview
This commit is contained in:
parent
a705fbd497
commit
28e91959e5
|
@ -44,6 +44,7 @@
|
|||
$: schemaOverrides = getSchemaOverrides(parsedColumns)
|
||||
$: enrichedButtons = enrichButtons(buttons)
|
||||
$: selectedRows = deriveSelectedRows(gridContext)
|
||||
$: styles = patchStyles($component.styles, minHeight)
|
||||
$: data = { selectedRows: $selectedRows }
|
||||
$: actions = [
|
||||
{
|
||||
|
@ -128,17 +129,23 @@
|
|||
)
|
||||
}
|
||||
|
||||
const patchStyles = (styles, minHeight) => {
|
||||
return {
|
||||
...styles,
|
||||
normal: {
|
||||
...styles?.normal,
|
||||
"min-height": `${minHeight}px`,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
gridContext = grid.getContext()
|
||||
gridContext.minHeight.subscribe($height => (minHeight = $height))
|
||||
})
|
||||
</script>
|
||||
|
||||
<span style="--min-height:{minHeight}px">
|
||||
<div
|
||||
use:styleable={$component.styles}
|
||||
class:in-builder={$builderStore.inBuilder}
|
||||
>
|
||||
<div use:styleable={styles} class:in-builder={$builderStore.inBuilder}>
|
||||
<Grid
|
||||
bind:this={grid}
|
||||
datasource={table}
|
||||
|
@ -166,14 +173,10 @@
|
|||
on:rowclick={e => onRowClick?.({ row: e.detail })}
|
||||
/>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<Provider {data} {actions} />
|
||||
|
||||
<style>
|
||||
span {
|
||||
display: contents;
|
||||
}
|
||||
div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -182,7 +185,6 @@
|
|||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
height: 410px;
|
||||
min-height: var(--min-height);
|
||||
}
|
||||
div.in-builder :global(*) {
|
||||
pointer-events: none;
|
||||
|
|
Loading…
Reference in New Issue