Skip to content

Commit

Permalink
chore: replace Node.parentNode.removeChildren(Node) by Node.remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
hnrq committed Jun 26, 2022
1 parent c7a18c5 commit 6492a00
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Draggable/Plugins/Focusable/tests/Focusable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Focusable', () => {

afterEach(() => {
draggable.destroy();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

it('is included by default', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Draggable/Plugins/Mirror/Mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export default class Mirror extends AbstractPlugin {
this.draggable.trigger(mirrorDestroyEvent);

if (!mirrorDestroyEvent.canceled()) {
this.mirror.parentNode.removeChild(this.mirror);
this.mirror.remove();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Draggable/Plugins/Mirror/tests/Mirror.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Mirror', () => {

afterEach(() => {
draggable.destroy();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

it('creates mirror element on `drag:start`', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Draggable/Sensors/DragSensor/tests/DragSensor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('DragSensor', () => {

function teardown() {
dragSensor.detach();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
}

describe('common', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('MouseSensor', () => {

function teardown() {
mouseSensor.detach();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
}

describe('common', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('TouchSensor', () => {

function teardown() {
touchSensor.detach();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
}

describe('common', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Draggable/tests/Draggable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Draggable', () => {
});

afterEach(() => {
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

describe('.Plugins', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Droppable/tests/Droppable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Droppable', () => {

afterEach(() => {
droppable.destroy();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

describe('triggers', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/ResizeMirror/tests/ResizeMirror.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('ResizeMirror', () => {

afterEach(() => {
draggable.destroy();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

it('resizes mirror based on over element', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Sortable/tests/Sortable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Sortable', () => {

afterEach(() => {
sortable.destroy();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

it('triggers events', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Swappable/Swappable.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default class Swappable extends Draggable {
function withTempElement(callback) {
const tmpElement = document.createElement('div');
callback(tmpElement);
tmpElement.parentNode.removeChild(tmpElement);
tmpElement.remove();
}

function swap(source, over) {
Expand Down
2 changes: 1 addition & 1 deletion src/Swappable/tests/Swappable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Swappable', () => {

afterEach(() => {
swappable.destroy();
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

it('triggers events', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/closest/tests/closest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('utils', () => {
});

afterEach(() => {
sandbox.parentNode.removeChild(sandbox);
sandbox.remove();
});

it('should return null when no element specified', () => {
Expand Down

0 comments on commit 6492a00

Please sign in to comment.