Skip to content

Commit f988e83

Browse files
authored
Merge pull request #2910 from adumesny/master
yarn test STYLE fixes
2 parents 0153c4e + a9e4488 commit f988e83

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spec/gridstack-spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ describe('gridstack >', function() {
14351435
float: false,
14361436
};
14371437
var grid = GridStack.init(options);
1438-
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('DIV'); // any to access private _styles
1438+
expect((grid as any)._styles.parentElement.tagName).toBe('DIV'); // any to access private _styles
14391439
});
14401440
it('should add STYLE to HEAD if styleInHead === true >', function() {
14411441
var options = {
@@ -1445,7 +1445,7 @@ describe('gridstack >', function() {
14451445
styleInHead: true
14461446
};
14471447
var grid = GridStack.init(options);
1448-
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('HEAD'); // any to access private _styles
1448+
expect((grid as any)._styles.parentElement.tagName).toBe('HEAD'); // any to access private _styles
14491449
});
14501450
});
14511451

@@ -1458,11 +1458,11 @@ describe('gridstack >', function() {
14581458
});
14591459
it('should add STYLE to parent node as a default >', function() {
14601460
var grid = GridStack.init();
1461-
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('DIV');
1461+
expect((grid as any)._styles.parentElement.tagName).toBe('DIV');
14621462
});
14631463
it('should add STYLE to HEAD if styleInHead === true >', function() {
14641464
var grid = GridStack.init({styleInHead: true});
1465-
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('HEAD');
1465+
expect((grid as any)._styles.parentElement.tagName).toBe('HEAD');
14661466
});
14671467
});
14681468

src/gridstack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,10 +992,10 @@ export class GridStack {
992992
this.el.parentNode.removeChild(this.el);
993993
}
994994
this._removeStylesheet();
995-
if (this.parentGridNode) delete this.parentGridNode.subGrid;
995+
delete this.parentGridNode?.subGrid;
996996
delete this.parentGridNode;
997997
delete this.opts;
998-
delete this._placeholder.gridstackNode;
998+
delete this._placeholder?.gridstackNode;
999999
delete this._placeholder;
10001000
delete this.engine;
10011001
delete this.el.gridstack; // remove circular dependency that would prevent a freeing

0 commit comments

Comments
 (0)