From 2de2f03db8ad399fe788543068714fccd540db8b Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Sat, 26 Jun 2021 14:10:11 +0200 Subject: [PATCH] Implement blink on duplicate detected --- ts/editor/Tag.svelte | 22 +++++++++++++++++++ ts/editor/TagEditor.svelte | 44 +++++++++++++++++++++++++++----------- ts/editor/tags.ts | 8 ++++++- 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/ts/editor/Tag.svelte b/ts/editor/Tag.svelte index 9d896b320..d9cb189cf 100644 --- a/ts/editor/Tag.svelte +++ b/ts/editor/Tag.svelte @@ -10,11 +10,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export let name: string; export let active: boolean; + export let blink: boolean = false; const dispatch = createEventDispatcher(); let input: HTMLInputElement; + $: if (blink) { + setTimeout(() => (blink = false), 300); + } + function checkForActivation(): void { const selection = window.getSelection()!; active = selection.isCollapsed; @@ -56,6 +61,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html {:else}