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}