From b77646129735cb8e5b1716f9b045d5c68719f67d Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 17 May 2023 21:13:54 -0500 Subject: [PATCH] fix(web): unable to change person name (#2458) * fix(web): unable to change person name * name changed * chore: strongly-typed dispatcher --------- Co-authored-by: Jason Rasmussen --- .../lib/components/faces-page/edit-name-input.svelte | 12 ++++++++---- web/src/routes/(user)/people/[personId]/+page.svelte | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/web/src/lib/components/faces-page/edit-name-input.svelte b/web/src/lib/components/faces-page/edit-name-input.svelte index 9eca6402b3..ba9a7eb5c4 100644 --- a/web/src/lib/components/faces-page/edit-name-input.svelte +++ b/web/src/lib/components/faces-page/edit-name-input.svelte @@ -3,16 +3,21 @@ import { createEventDispatcher } from 'svelte'; import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte'; import Button from '../elements/buttons/button.svelte'; + import { clickOutside } from '$lib/utils/click-outside'; export let person: PersonResponseDto; let name = person.name; - const dispatch = createEventDispatcher<{ change: string }>(); - const handleNameChange = () => dispatch('change', name); + const dispatch = createEventDispatcher<{ + change: string; + cancel: void; + }>();
dispatch('cancel')} > dispatch('change', name)} > diff --git a/web/src/routes/(user)/people/[personId]/+page.svelte b/web/src/routes/(user)/people/[personId]/+page.svelte index 7c22215396..3b0cbe75fd 100644 --- a/web/src/routes/(user)/people/[personId]/+page.svelte +++ b/web/src/routes/(user)/people/[personId]/+page.svelte @@ -70,7 +70,7 @@ handleNameChange(event.detail)} - on:blur={() => (isEditName = false)} + on:cancel={() => (isEditName = false)} /> {:else}