react-beautiful-dnd
Advanced tools
Comparing version 12.0.0-beta.4 to 12.0.0-beta.5
{ | ||
"name": "react-beautiful-dnd", | ||
"version": "12.0.0-beta.4", | ||
"version": "12.0.0-beta.5", | ||
"description": "Beautiful and accessible drag and drop for lists with React", | ||
@@ -5,0 +5,0 @@ "author": "Alex Reardon <areardon@atlassian.com>", |
@@ -21,2 +21,3 @@ // @flow | ||
import calculateCombineImpact from '../calculate-drag-impact/calculate-combine-impact'; | ||
import getDisplacedBy from '../get-displaced-by'; | ||
@@ -108,3 +109,6 @@ function getWhenEntered( | ||
const displaced: DisplacementGroups = previousImpact.displaced; | ||
const canBeDisplacedBy: DisplacedBy = previousImpact.displacedBy; | ||
const canBeDisplacedBy: DisplacedBy = getDisplacedBy( | ||
destination.axis, | ||
draggable.displaceBy, | ||
); | ||
const lastCombineImpact: ?CombineImpact = tryGetCombineImpact(previousImpact); | ||
@@ -111,0 +115,0 @@ |
@@ -49,2 +49,3 @@ // @flow | ||
import findDraggable from '../get-elements/find-draggable'; | ||
import bindEvents from '../event-bindings/bind-events'; | ||
@@ -241,8 +242,18 @@ function preventDefault(event: Event) { | ||
if (options.shouldBlockNextClick) { | ||
window.addEventListener('click', preventDefault, { | ||
// only blocking a single click | ||
once: true, | ||
passive: false, | ||
capture: true, | ||
}); | ||
const unbind = bindEvents(window, [ | ||
{ | ||
eventName: 'click', | ||
fn: preventDefault, | ||
options: { | ||
// only blocking a single click | ||
once: true, | ||
passive: false, | ||
capture: true, | ||
}, | ||
}, | ||
]); | ||
// Sometimes the click is swallowed, such as when there is reparenting | ||
// The click event (in the message queue) will occur before the next setTimeout expiry | ||
// https://codesandbox.io/s/click-behaviour-pkfk2 | ||
setTimeout(unbind); | ||
} | ||
@@ -249,0 +260,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1400667
38560