fix: delete in structure

This commit is contained in:
2025-11-04 14:40:41 +01:00
parent 600aeb5a6a
commit 02a2333a41
@@ -69,6 +69,12 @@ const getScrollY = () => (typeof window !== "undefined" ? window.scrollY : 0);
const randomSuffix = () => Math.random().toString(36).slice(2, 8); const randomSuffix = () => Math.random().toString(36).slice(2, 8);
const stopPointerEventPropagation = (event) => {
event?.stopPropagation?.();
event?.preventDefault?.();
event?.nativeEvent?.stopImmediatePropagation?.();
};
const createSortableItem = (type, occurrence = 1) => ({ const createSortableItem = (type, occurrence = 1) => ({
id: `${type}-${occurrence}-${randomSuffix()}`, id: `${type}-${occurrence}-${randomSuffix()}`,
type, type,
@@ -691,9 +697,10 @@ const CustomizeSongStructure = ({ baseStructure = [], onChange }) => {
<View style={styles.rowActions}> <View style={styles.rowActions}>
{canRemove && ( {canRemove && (
<TouchableOpacity <TouchableOpacity
onPressIn={(ev) => ev?.stopPropagation?.()} onPointerDown={stopPointerEventPropagation}
onPressIn={stopPointerEventPropagation}
onPress={(ev) => { onPress={(ev) => {
ev?.stopPropagation?.(); stopPointerEventPropagation(ev);
handleRemoveItem(item.id); handleRemoveItem(item.id);
}} }}
style={styles.removeButton} style={styles.removeButton}