@atlaskit/drag-and-drop
Advanced tools
Comparing version 0.14.0 to 0.15.0
# @atlaskit/drag-and-drop | ||
## 0.15.0 | ||
### Minor Changes | ||
- [`ed028658f13`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ed028658f13) - Minor internal refactor and adding additional tests | ||
## 0.14.0 | ||
@@ -4,0 +10,0 @@ |
@@ -26,14 +26,8 @@ "use strict"; | ||
/** | ||
* Allow the user to continue to interact with what their cursor is over at the end of the drag. | ||
* Allow the user to continue to interact with the element their pointer is over at the end of the drag. | ||
* This is important to allow the user to be able to click, drag (etc) after they have finished a drag | ||
* | ||
* @description | ||
* | ||
* 1. Allow pointer events on the element under the users pointer | ||
* 2. Block pointer events for all children | ||
* This is done as the element under the users pointer might | ||
* contain elements that will incorrectly get browser selection | ||
* | ||
* @returns a `cleanup` function to restore all elements under the users pointer to their original state | ||
*/ | ||
function fixUnderPointer(_ref2) { | ||
function allowPointerEventsOnElementUnderPointer(_ref2) { | ||
var current = _ref2.current; | ||
@@ -86,7 +80,9 @@ var underUsersPointer = document.elementFromPoint(current.input.clientX, current.input.clientY); | ||
queueMicrotask(function () { | ||
// Applying fix to element under the pointer before disabling pointer events everywhere, | ||
// Otherwise `element.elementFromPoint` would return `<html>` (document.documentElement) | ||
var undoUnderPointer = fixUnderPointer({ | ||
var undoUnderPointer = allowPointerEventsOnElementUnderPointer({ | ||
current: current | ||
}); | ||
// This will also block pointer-events on the children of the element under the users pointer. | ||
// This is what we want. If the user drops on a container element we don't want the children | ||
// of the container to be incorrectly entered into | ||
var undoGlobalBlock = blockPointerEventsOnEverything(); | ||
@@ -93,0 +89,0 @@ function cleanup() { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"sideEffects": false | ||
} |
@@ -20,14 +20,8 @@ import { bindAll } from 'bind-event-listener'; | ||
/** | ||
* Allow the user to continue to interact with what their cursor is over at the end of the drag. | ||
* Allow the user to continue to interact with the element their pointer is over at the end of the drag. | ||
* This is important to allow the user to be able to click, drag (etc) after they have finished a drag | ||
* | ||
* @description | ||
* | ||
* 1. Allow pointer events on the element under the users pointer | ||
* 2. Block pointer events for all children | ||
* This is done as the element under the users pointer might | ||
* contain elements that will incorrectly get browser selection | ||
* | ||
* @returns a `cleanup` function to restore all elements under the users pointer to their original state | ||
*/ | ||
function fixUnderPointer({ | ||
function allowPointerEventsOnElementUnderPointer({ | ||
current | ||
@@ -82,7 +76,9 @@ }) { | ||
queueMicrotask(() => { | ||
// Applying fix to element under the pointer before disabling pointer events everywhere, | ||
// Otherwise `element.elementFromPoint` would return `<html>` (document.documentElement) | ||
const undoUnderPointer = fixUnderPointer({ | ||
const undoUnderPointer = allowPointerEventsOnElementUnderPointer({ | ||
current | ||
}); | ||
// This will also block pointer-events on the children of the element under the users pointer. | ||
// This is what we want. If the user drops on a container element we don't want the children | ||
// of the container to be incorrectly entered into | ||
const undoGlobalBlock = blockPointerEventsOnEverything(); | ||
@@ -89,0 +85,0 @@ function cleanup() { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"sideEffects": false | ||
} |
@@ -20,14 +20,8 @@ import { bindAll } from 'bind-event-listener'; | ||
/** | ||
* Allow the user to continue to interact with what their cursor is over at the end of the drag. | ||
* Allow the user to continue to interact with the element their pointer is over at the end of the drag. | ||
* This is important to allow the user to be able to click, drag (etc) after they have finished a drag | ||
* | ||
* @description | ||
* | ||
* 1. Allow pointer events on the element under the users pointer | ||
* 2. Block pointer events for all children | ||
* This is done as the element under the users pointer might | ||
* contain elements that will incorrectly get browser selection | ||
* | ||
* @returns a `cleanup` function to restore all elements under the users pointer to their original state | ||
*/ | ||
function fixUnderPointer(_ref2) { | ||
function allowPointerEventsOnElementUnderPointer(_ref2) { | ||
var current = _ref2.current; | ||
@@ -80,7 +74,9 @@ var underUsersPointer = document.elementFromPoint(current.input.clientX, current.input.clientY); | ||
queueMicrotask(function () { | ||
// Applying fix to element under the pointer before disabling pointer events everywhere, | ||
// Otherwise `element.elementFromPoint` would return `<html>` (document.documentElement) | ||
var undoUnderPointer = fixUnderPointer({ | ||
var undoUnderPointer = allowPointerEventsOnElementUnderPointer({ | ||
current: current | ||
}); | ||
// This will also block pointer-events on the children of the element under the users pointer. | ||
// This is what we want. If the user drops on a container element we don't want the children | ||
// of the container to be incorrectly entered into | ||
var undoGlobalBlock = blockPointerEventsOnEverything(); | ||
@@ -87,0 +83,0 @@ function cleanup() { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"description": "The core Atlassian drag and drop framework, optimized for performance.", | ||
@@ -5,0 +5,0 @@ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror", |
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
247359
5831