Thanks to visit codestin.com
Credit goes to github.com

Skip to content

yarn test STYLE fixes #2910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec/gridstack-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ describe('gridstack >', function() {
float: false,
};
var grid = GridStack.init(options);
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('DIV'); // any to access private _styles
expect((grid as any)._styles.parentElement.tagName).toBe('DIV'); // any to access private _styles
});
it('should add STYLE to HEAD if styleInHead === true >', function() {
var options = {
Expand All @@ -1445,7 +1445,7 @@ describe('gridstack >', function() {
styleInHead: true
};
var grid = GridStack.init(options);
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('HEAD'); // any to access private _styles
expect((grid as any)._styles.parentElement.tagName).toBe('HEAD'); // any to access private _styles
});
});

Expand All @@ -1458,11 +1458,11 @@ describe('gridstack >', function() {
});
it('should add STYLE to parent node as a default >', function() {
var grid = GridStack.init();
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('DIV');
expect((grid as any)._styles.parentElement.tagName).toBe('DIV');
});
it('should add STYLE to HEAD if styleInHead === true >', function() {
var grid = GridStack.init({styleInHead: true});
expect((grid as any)._styles.ownerNode.parentNode.tagName).toBe('HEAD');
expect((grid as any)._styles.parentElement.tagName).toBe('HEAD');
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,10 +992,10 @@ export class GridStack {
this.el.parentNode.removeChild(this.el);
}
this._removeStylesheet();
if (this.parentGridNode) delete this.parentGridNode.subGrid;
delete this.parentGridNode?.subGrid;
delete this.parentGridNode;
delete this.opts;
delete this._placeholder.gridstackNode;
delete this._placeholder?.gridstackNode;
delete this._placeholder;
delete this.engine;
delete this.el.gridstack; // remove circular dependency that would prevent a freeing
Expand Down