fix(frontend): invisible subgrids have h-0 + app policies fix

This commit is contained in:
Ruben Fiszel
2023-02-27 18:38:22 +01:00
parent 42d1cd6456
commit 2244e83b9d
3 changed files with 15 additions and 3 deletions
@@ -31,6 +31,15 @@
function handleTabSelection() {
outputs?.selectedTabIndex.set(selectedIndex)
if ($selectedComponent != id) {
$selectedComponent = id
}
if ($focusedGrid?.parentComponentId != id || $focusedGrid?.subGridIndex != selectedIndex) {
$focusedGrid = {
parentComponentId: id,
subGridIndex: selectedIndex
}
}
}
$: selectedIndex >= 0 && handleTabSelection()
@@ -51,7 +51,7 @@
UserAppInput
} from '../inputType'
import type { AppEditorContext } from '../types'
import { toStatic } from '../utils'
import { allItems, toStatic } from '../utils'
import AppExportButton from './AppExportButton.svelte'
import AppInputs from './AppInputs.svelte'
import type { AppComponent } from './component/components'
@@ -124,7 +124,7 @@
}
async function computeTriggerables() {
const allTriggers = await Promise.all(
$app.grid
allItems($app.grid, $app.subgrids)
.flatMap((x) => {
let c = x.data as AppComponent
let r: (AppInput | undefined)[] = [c.componentInput]
@@ -59,7 +59,10 @@
let container
</script>
<div class="relative w-full subgrid {visible ? 'visible' : 'invisible h-0 '}" bind:this={container}>
<div
class="relative w-full subgrid {visible ? 'visible' : 'invisible h-0 overflow-hidden'}"
bind:this={container}
>
<div
class:px-2={!noPadding}
class="py-2 overflow-auto {$connectingInput?.opened ? '' : ''}"