File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,17 @@ const {
127127 getCardStyle,
128128} = useStackTransform (() => ({ ... config .value }))
129129
130+ /**
131+ * Determines if drag should be disabled on cards
132+ *
133+ * Drag is disabled when:
134+ * - `disableDrag` prop is explicitly set to true
135+ * - `waitAnimationEnd` is enabled AND there are cards currently in transition
136+ * This prevents race conditions where a user can drag a new card while
137+ * the previous card is still animating, which causes cards to hang/freeze
138+ */
139+ const isDragDisabled = computed (() => props .disableDrag || (config .value .waitAnimationEnd && hasCardsInTransition .value ))
140+
130141/**
131142 * Handles card swipe completion
132143 */
@@ -215,6 +226,7 @@ defineExpose({
215226 v-bind =" props"
216227 class =" flashcards__card"
217228 :class =" { 'flashcards__card--active': itemId === currentItemId }"
229+ :disable-drag =" isDragDisabled"
218230 @complete =" (action, pos) => handleCardSwipe(itemId, action, pos)"
219231 @mounted =" containerHeight = Math.max($event, 0)"
220232 @dragstart =" emit('dragstart', item)"
You can’t perform that action at this time.
0 commit comments