From a7eb3e0072f23cca3358692d54d1c1b4e635eae5 Mon Sep 17 00:00:00 2001 From: Benjamin Fan Date: Mon, 19 May 2025 08:02:56 +0200 Subject: [PATCH] fix(react): Allow bookmark title to be edited (#366) Currently it isn't possible to edit the title of a bookmark (for example, when bookmarking a Measurements Set) for 2 reasons: 1. The modal closes as soon as you click in the title text edit box. 2. The created bookmark uses the original title, ignoring edits made to it. This PR fixes both issues. Co-authored-by: Benjamin Fan Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/366 Reviewed-by: Joost De Cock Co-authored-by: Benjamin Fan Co-committed-by: Benjamin Fan --- packages/react/components/Account/Bookmarks.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react/components/Account/Bookmarks.mjs b/packages/react/components/Account/Bookmarks.mjs index cd25e37bb32..c6eed2402eb 100644 --- a/packages/react/components/Account/Bookmarks.mjs +++ b/packages/react/components/Account/Bookmarks.mjs @@ -259,7 +259,12 @@ export const BookmarkButton = ({ slug, type, title }) => { className={`tw:daisy-btn tw:daisy-btn-secondary tw:daisy-btn-outline ${horFlexClasses}`} onClick={() => setModal( - + ) @@ -291,6 +296,7 @@ export const CreateBookmark = ({ type, title, slug }) => { const bookmark = async (evt) => { evt.stopPropagation() setLoadingStatus([true, 'Contacting backend']) + let title = name const [status] = await backend.createBookmark({ type, title, url }) if (status === 201) { setLoadingStatus([true, 'Bookmark created', true, true])