Skip to content

Commit 135878a

Browse files
committed
fix(mobile): swipe on node link opens the node
1 parent 52dae0f commit 135878a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/frontend/handler/block.cljs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,11 @@
363363
(reset! *swiped? true)
364364
(dom/set-style! block-container :transform (util/format "translateX(%dpx)" left)))))))))))))
365365

366+
(defonce ^:private *swipe-timeout (atom nil))
366367
(defn on-touch-end
367368
[event]
369+
(when-let [timeout @*swipe-timeout]
370+
(js/clearTimeout timeout))
368371
(util/stop-propagation event)
369372
(when @*swipe
370373
(let [target (.-target event)
@@ -389,10 +392,11 @@
389392
(when (:mobile/show-action-bar? @state/state)
390393
(state/set-state! :mobile/show-action-bar? false)))
391394
(haptics/haptics)))
392-
(reset! *swiped? false)
393395
(catch :default e
394396
(js/console.error e))
395397
(finally
398+
(reset! *swipe-timeout
399+
(js/setTimeout #(reset! *swiped? false) 50))
396400
(reset! *swipe nil)
397401
(reset! *touch-start nil))))))
398402

0 commit comments

Comments
 (0)