mirror of
https://github.com/Shopify/draggable.git
synced 2025-12-08 20:15:56 +00:00
14 lines
435 B
JavaScript
14 lines
435 B
JavaScript
export function createSandbox(content) {
|
|
const sandbox = document.createElement('div');
|
|
sandbox.innerHTML = content;
|
|
document.body.appendChild(sandbox);
|
|
return sandbox;
|
|
}
|
|
|
|
export function withElementFromPoint(elementFromPoint, callback) {
|
|
const originalElementFromPoint = document.elementFromPoint;
|
|
document.elementFromPoint = () => elementFromPoint;
|
|
callback();
|
|
document.elementFromPoint = originalElementFromPoint;
|
|
}
|