Fix editor dropdowns (#1649)

This commit is contained in:
Henrik Giesel 2022-02-08 05:13:55 +01:00 committed by GitHub
parent c0d47e18b7
commit 30427fb540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
--> -->
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from "svelte"; import { createEventDispatcher, onMount } from "svelte";
export let container: HTMLElement; export let container: HTMLElement;
export let image: HTMLImageElement; export let image: HTMLImageElement;
@ -43,10 +43,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
let selectionRef: HTMLDivElement;
function initSelection(selection: HTMLDivElement): void { function initSelection(selection: HTMLDivElement): void {
setSelection(); setSelection();
dispatch("mount", { selection }); selectionRef = selection;
} }
onMount(() => dispatch("mount", { selection: selectionRef }));
</script> </script>
<div <div