new background and fixs

This commit is contained in:
2025-10-23 10:53:34 +02:00
parent ebe26542fe
commit 8024f71e1c
8 changed files with 71 additions and 70 deletions
@@ -159,29 +159,26 @@ const CustomizeSongStructure = ({ baseStructure = [], onChange }) => {
[extractValues]
);
const handleGrant = useCallback(
(itemId, event) => {
const rect = containerRef.current?.getBoundingClientRect();
const scrollY = getScrollY();
const nativeEvent = event.nativeEvent || {};
const fallbackY =
typeof nativeEvent.pageY === "number"
? nativeEvent.pageY
: typeof nativeEvent.clientY === "number"
? nativeEvent.clientY + scrollY
: scrollY;
const containerTop = rect ? rect.top + scrollY : fallbackY;
dragStateRef.current = {
itemId,
containerTop,
};
setActiveItemId(itemId);
if (typeof document !== "undefined") {
document.body.style.userSelect = "none";
}
},
[]
);
const handleGrant = useCallback((itemId, event) => {
const rect = containerRef.current?.getBoundingClientRect();
const scrollY = getScrollY();
const nativeEvent = event.nativeEvent || {};
const fallbackY =
typeof nativeEvent.pageY === "number"
? nativeEvent.pageY
: typeof nativeEvent.clientY === "number"
? nativeEvent.clientY + scrollY
: scrollY;
const containerTop = rect ? rect.top + scrollY : fallbackY;
dragStateRef.current = {
itemId,
containerTop,
};
setActiveItemId(itemId);
if (typeof document !== "undefined") {
document.body.style.userSelect = "none";
}
}, []);
const handleMove = useCallback((event) => {
const { itemId, containerTop } = dragStateRef.current;
@@ -210,9 +207,7 @@ const CustomizeSongStructure = ({ baseStructure = [], onChange }) => {
}, []);
const handleRelease = useCallback(() => {
setSortableItems((prev) =>
buildSortableItems(extractValues(prev))
);
setSortableItems((prev) => buildSortableItems(extractValues(prev)));
dragStateRef.current = {
itemId: null,
containerTop: 0,