From e6d85e63a89931821277c180344f7ad1c2ae7144 Mon Sep 17 00:00:00 2001 From: Honey Date: Wed, 27 May 2026 00:40:16 +0200 Subject: [PATCH] fix: clear sort tag fields synchronously before async fill Sort tag fields were not reset when opening a new song's edit modal, so values from the previously opened song persisted until the async romaji index fetch completed (or indefinitely if it found no entry). Co-Authored-By: Claude Sonnet 4.6 --- src/ui.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui.js b/src/ui.js index 77e0f74..afbd317 100644 --- a/src/ui.js +++ b/src/ui.js @@ -352,6 +352,12 @@ export function toggleInfoEdit() { document.getElementById('ie-disc').value = s.discNumber || ''; document.getElementById('ie-totaltracks').value = s.albumSongCount || ''; + // Clear sort fields immediately so stale values from a previously opened song don't show + document.getElementById('ie-titlesort').value = ''; + document.getElementById('ie-artistsort').value = ''; + document.getElementById('ie-albumartistsort').value = ''; + document.getElementById('ie-albumsort').value = ''; + // Sort tags: fetch romaji index on demand (cached if already loaded), then overwrite with // actual file tags from backend. This works regardless of the showRomaji toggle. const _sId = s.id;