From 02a2333a41dc55153b61fcfcd3948139be29431a Mon Sep 17 00:00:00 2001 From: leon-morival Date: Tue, 4 Nov 2025 14:40:41 +0100 Subject: [PATCH] fix: delete in structure --- src/screens/Writing/CustomizeSongStructure.web.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/screens/Writing/CustomizeSongStructure.web.js b/src/screens/Writing/CustomizeSongStructure.web.js index 425d542..605a264 100644 --- a/src/screens/Writing/CustomizeSongStructure.web.js +++ b/src/screens/Writing/CustomizeSongStructure.web.js @@ -69,6 +69,12 @@ const getScrollY = () => (typeof window !== "undefined" ? window.scrollY : 0); const randomSuffix = () => Math.random().toString(36).slice(2, 8); +const stopPointerEventPropagation = (event) => { + event?.stopPropagation?.(); + event?.preventDefault?.(); + event?.nativeEvent?.stopImmediatePropagation?.(); +}; + const createSortableItem = (type, occurrence = 1) => ({ id: `${type}-${occurrence}-${randomSuffix()}`, type, @@ -691,9 +697,10 @@ const CustomizeSongStructure = ({ baseStructure = [], onChange }) => { {canRemove && ( ev?.stopPropagation?.()} + onPointerDown={stopPointerEventPropagation} + onPressIn={stopPointerEventPropagation} onPress={(ev) => { - ev?.stopPropagation?.(); + stopPointerEventPropagation(ev); handleRemoveItem(item.id); }} style={styles.removeButton}