From 51922760627ab92ef3fc377f0ebdbd535eb1a6ab Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Thu, 7 Oct 2021 18:22:36 -0400 Subject: [PATCH] Make clicking edit tag button easier Currently, tags will be dragged immediately on touch, which makes it very hard to click the edit button, as any non-perfect touch drags the tag. This commit adds a delay on mobile devices only, so that the tag can be both dragged and edited easily. Closes https://github.com/flarum/core/issues/3098 --- extensions/tags/js/src/admin/components/TagsPage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/tags/js/src/admin/components/TagsPage.js b/extensions/tags/js/src/admin/components/TagsPage.js index c21c58f83..c553a7a08 100644 --- a/extensions/tags/js/src/admin/components/TagsPage.js +++ b/extensions/tags/js/src/admin/components/TagsPage.js @@ -150,6 +150,9 @@ export default class TagsPage extends ExtensionPage { this.$('.TagList').get().map(e => { sortable.create(e, { group: 'tags', + delay: 50, + delayOnTouchOnly: true, + touchStartThreshold: 5, animation: 150, swapThreshold: 0.65, dragClass: 'sortable-dragging',