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;