mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
Fix CTRL click triggers sortable mode (#40)
This commit is contained in:
parent
0a38b6d886
commit
803f07ec6f
1 changed files with 17 additions and 0 deletions
17
patches/react-sortable-hoc+1.10.1.patch
Normal file
17
patches/react-sortable-hoc+1.10.1.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js b/node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js
|
||||
index e996530..81fb119 100644
|
||||
--- a/node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js
|
||||
+++ b/node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js
|
||||
@@ -582,7 +582,11 @@ function sortableContainer(WrappedComponent) {
|
||||
distance = _this$props.distance,
|
||||
shouldCancelStart = _this$props.shouldCancelStart;
|
||||
|
||||
- if (event.button === 2 || shouldCancelStart(event)) {
|
||||
+ // https://github.com/clauderic/react-sortable-hoc/issues/256
|
||||
+ var isRightClick = (event.buttons === 1 && event.ctrlKey === true) // macOS trackpad ctrl click
|
||||
+ || event.which === 3 || event.button === 2; // Regular mouse or macOS double-finger tap
|
||||
+
|
||||
+ if (isRightClick || shouldCancelStart(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue