fix: "back to beginning" button should also shift viewport to the beginning of the song

This commit is contained in:
Xiaohan-Tian
2026-05-04 17:02:39 -07:00
parent fc304ac349
commit 769d70ccb4
+4 -1
View File
@@ -53,7 +53,8 @@ const Toolbar: React.FC = () => {
// Selection state // Selection state
selectedRegionIds, selectedRegionIds,
// Playhead and refresh // Playhead and refresh
playheadPosition, refreshProjectState playheadPosition, refreshProjectState,
requestMainContentScroll, requestPianoRollScroll
} = useProjectStore(); } = useProjectStore();
// State for main content tools // State for main content tools
@@ -533,6 +534,8 @@ const Toolbar: React.FC = () => {
console.log("Back to beginning button clicked"); console.log("Back to beginning button clicked");
} }
setPlayheadPosition(0); setPlayheadPosition(0);
requestMainContentScroll(0);
requestPianoRollScroll(0);
}; };
const handleLoopToggle = () => { const handleLoopToggle = () => {