fix: delete in structure
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user