Skip to content

Commit 34a5aea

Browse files
committed
fix: normalize undefined Vimeo config to null to prevent unnecessary reload
1 parent 12f379e commit 34a5aea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/vimeo-video-element/vimeo-video-element.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ class VimeoVideoElement extends MediaPlayedRangesMixin(globalThis.HTMLElement ??
140140
}
141141

142142
set config(value) {
143+
// Normalize undefined to null so config = undefined (e.g. from react-player)
144+
// matches the null default and doesn't trigger an unnecessary reload. Needed
145+
// because JSON.stringify(undefined) is undefined (not the string "null").
146+
value ??= null;
143147
if (JSON.stringify(this.#config) === JSON.stringify(value)) return;
144148
this.#config = value;
145149
this.load();

0 commit comments

Comments
 (0)