Skip to content

Commit 79254ac

Browse files
committed
Remove undefined dimensions from properties
1 parent 71cee06 commit 79254ac

File tree

6 files changed

+52
-36
lines changed

6 files changed

+52
-36
lines changed

package-lock.json

Lines changed: 29 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"@tsconfig/node22": "22.0.2",
8989
"@tsconfig/strictest": "2.0.7",
9090
"@types/defined": "1.0.2",
91-
"@types/node": "24.10.0",
91+
"@types/node": "24.10.1",
9292
"@types/superagent": "8.1.9",
9393
"@types/ua-parser-js": "0.7.39",
9494
"@vitest/eslint-plugin": "1.4.2",
@@ -100,14 +100,14 @@
100100
"eslint-plugin-de-morgan": "2.0.0",
101101
"eslint-plugin-depend": "1.3.1",
102102
"eslint-plugin-import-x": "4.16.1",
103-
"eslint-plugin-package-json": "0.65.3",
103+
"eslint-plugin-package-json": "0.68.0",
104104
"eslint-plugin-promise": "7.2.1",
105105
"eslint-plugin-regexp": "2.10.0",
106106
"eslint-plugin-security": "3.0.1",
107107
"eslint-plugin-simple-import-sort": "12.1.1",
108108
"eslint-plugin-storybook": "9.1.16",
109109
"globals": "16.5.0",
110-
"jsdom": "27.1.0",
110+
"jsdom": "27.2.0",
111111
"msw": "2.11.6",
112112
"msw-storybook-addon": "2.0.6",
113113
"prettier": "3.6.2",

src/wrappers/container.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,16 @@ class Container extends Despot {
342342
if (this.options.video.stretch) {
343343
this.removeDimensions();
344344
} else if (this.containerElement) {
345-
let dimension = useFullWidth(this.options.video.mobileBreakPoint);
345+
let widthDimension = useFullWidth(this.options.video.mobileBreakPoint);
346346

347-
if (!dimension) {
348-
dimension = this.visuals.getRecorderWidth(true);
347+
if (!widthDimension) {
348+
widthDimension = this.visuals.getRecorderWidth(true);
349349
}
350350

351-
if (dimension?.value) {
352-
this.containerElement.style.width = `${dimension.value}${dimension.unit}`;
351+
if (widthDimension?.value) {
352+
this.containerElement.style.width = `${widthDimension.value}${widthDimension.unit}`;
353+
} else {
354+
this.containerElement.style.removeProperty("width");
353355
}
354356
}
355357
}

src/wrappers/visuals.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,14 @@ class Visuals extends Despot {
129129

130130
if (widthDimension) {
131131
this.visualsElement.style.width = `${widthDimension.value}${widthDimension.unit}`;
132+
} else {
133+
this.visualsElement.style.removeProperty("width");
132134
}
133135

134136
if (heightDimension) {
135137
this.visualsElement.style.height = `${heightDimension.value}${heightDimension.unit}`;
138+
} else {
139+
this.visualsElement.style.removeProperty("height");
136140
}
137141
}
138142
}

src/wrappers/visuals/notifier.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,14 @@ class Notifier extends Despot {
175175

176176
if (widthDimension) {
177177
this.notifyElement.style.width = `${widthDimension.value}${widthDimension.unit}`;
178+
} else {
179+
this.notifyElement.style.removeProperty("width");
178180
}
179181

180182
if (heightDimension) {
181183
this.notifyElement.style.height = `${heightDimension.value}${heightDimension.unit}`;
184+
} else {
185+
this.notifyElement.style.removeProperty("height");
182186
}
183187
}
184188
}

src/wrappers/visuals/recorder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,12 +1330,15 @@ class Recorder extends Despot {
13301330

13311331
if (this.options.video.stretch || widthDimension) {
13321332
this.recorderElement.style.width = "100%";
1333+
this.recorderElement.style.removeProperty("height");
13331334
} else {
13341335
if (this.options.video.width) {
13351336
const recorderWidth = this.getRecorderWidth(true);
13361337

13371338
if (recorderWidth?.value) {
13381339
this.recorderElement.width = recorderWidth.value;
1340+
} else {
1341+
this.recorderElement.style.removeProperty("width");
13391342
}
13401343
}
13411344

@@ -1344,6 +1347,8 @@ class Recorder extends Despot {
13441347

13451348
if (recorderHeight.value) {
13461349
this.recorderElement.height = recorderHeight.value;
1350+
} else {
1351+
this.recorderElement.style.removeProperty("height");
13471352
}
13481353
}
13491354
}

0 commit comments

Comments
 (0)