1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00

fix bug when switching between tabs

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-20 16:57:38 +02:00
parent 302e001eb5
commit eaa2821e75

View file

@ -1,5 +1,5 @@
<script>
import { onMount } from "svelte"
import { onMount, tick } from "svelte"
import {
Button,
Detail,
@ -44,6 +44,16 @@
onMount(() => {
mounted = true
})
async function fixMountBug({ detail }) {
console.log(detail)
if (detail === "Edit") {
await tick()
mounted = true
} else {
mounted = false
}
}
</script>
<Page wide>
@ -69,7 +79,7 @@
menu on the right.</Body
>
</Layout>
<Tabs selected="Edit">
<Tabs selected="Edit" on:select={fixMountBug}>
<Tab title="Edit">
<div class="template-editor">
<Editor