File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 218218 const isHorizontalSwipe = absDeltaX > 50 && absDeltaX > absDeltaY ;
219219
220220 if ( isHorizontalSwipe ) {
221+ // Prevent default navigation
222+ e . preventDefault ( ) ;
221223 // Swipe left = show modern, swipe right = show old
222224 if ( deltaX < 0 ) {
223225 // Swipe left - show modern
228230 }
229231 } else if ( absDeltaX < 10 && absDeltaY < 10 ) {
230232 // It's a tap (movement under 10px threshold)
233+ e . preventDefault ( ) ;
231234 card . classList . toggle ( 'toggled' ) ;
232235 }
233- } , { passive : true } ) ;
236+ } , { passive : false } ) ;
234237
235- // Prevent click events from propagating when on touch devices
236- // to avoid navigation when toggling
238+ // Prevent click events on card-code from navigating
239+ // (the touch handlers above already handle the interaction)
237240 card . addEventListener ( 'click' , ( e ) => {
238241 if ( e . target . closest ( '.card-code' ) ) {
239242 e . preventDefault ( ) ;
You can’t perform that action at this time.
0 commit comments