From 9a2b3410d0ead37ae1da408d68e14507a058a613 Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Thu, 11 Aug 2022 23:57:53 +0200 Subject: [PATCH] Add slide out animation to EditingArea, RichTextInput and PlainTextInput only for collapsing, because it is choppy on expansion (common issue with Svelte transitions). --- ts/editor/EditingArea.svelte | 8 +- .../plain-text-input/PlainTextInput.svelte | 35 ++++---- .../rich-text-input/RichTextInput.svelte | 81 ++++++++++--------- 3 files changed, 66 insertions(+), 58 deletions(-) diff --git a/ts/editor/EditingArea.svelte b/ts/editor/EditingArea.svelte index 401611501..5df3ffeed 100644 --- a/ts/editor/EditingArea.svelte +++ b/ts/editor/EditingArea.svelte @@ -51,6 +51,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { fontFamilyKey, fontSizeKey } from "../lib/context-keys"; import FocusTrap from "./FocusTrap.svelte"; + import { slide } from "svelte/transition"; export let fontFamily: string; const fontFamilyStore = writable(fontFamily); @@ -177,7 +178,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -
+
diff --git a/ts/editor/plain-text-input/PlainTextInput.svelte b/ts/editor/plain-text-input/PlainTextInput.svelte index 9b451c596..d533b5f5c 100644 --- a/ts/editor/plain-text-input/PlainTextInput.svelte +++ b/ts/editor/plain-text-input/PlainTextInput.svelte @@ -38,6 +38,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { context as noteEditorContext } from "../NoteEditor.svelte"; import removeProhibitedTags from "./remove-prohibited"; import { storedToUndecorated, undecoratedToStored } from "./transform"; + import { slide } from "svelte/transition"; export let hidden: boolean; @@ -140,20 +141,22 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html setupLifecycleHooks(api); -
($focusedInput = api)} -> - -
+{#if !hidden} +
($focusedInput = api)} + out:slide={{ duration: 200 }} + > + +
+{/if}