Skip to content

Commit

Permalink
don't open the edit slideout if we are tapholding to drag
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Feb 12, 2024
1 parent 06da832 commit b8817bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions src/web/assets/cp/src/js/ComponentSelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,14 @@ Craft.ComponentSelectInput = Garnish.Base.extend(
}).appendTo($component.find('.chip-actions'));
}

this.addListener($component, 'dblclick,taphold', () => {
disclosureMenu.$container.find('[data-edit-action]').click();
this.addListener($component, 'dblclick,taphold', (ev) => {
// don't open the edit slideout if we are tapholding to drag
if (
ev.type !== 'taphold' ||
!$(ev.originalEvent.originalTarget).hasClass('move')
) {
disclosureMenu.$container.find('[data-edit-action]').click();
}
});

this.hideOption($component.data('id'));
Expand Down

0 comments on commit b8817bf

Please sign in to comment.