Skip to content

Commit

Permalink
fix: 🐛 auto appendChild works only for not defined remount
Browse files Browse the repository at this point in the history
  • Loading branch information
mjancarik committed May 23, 2024
1 parent 2471f91 commit a4a761a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/create-widget/views/preact/template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@merkur/preact": "0.35.0"
"@merkur/preact": "0.36.0"
},
"devDependencies": {
"enzyme": "3.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-widget/views/svelte/template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@merkur/svelte": "0.35.0"
"@merkur/svelte": "0.36.0"
},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion packages/create-widget/views/uhtml/template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@merkur/uhtml": "0.35.0"
"@merkur/uhtml": "0.36.0"
},
"devDependencies": {}
}
14 changes: 10 additions & 4 deletions packages/integration-custom-element/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ function registerCustomElement(options) {
customElement: this,
});

(await callbacks?.remount?.(this._widget, {
shadow: this._shadow,
customElement: this,
})) ?? this._shadow.appendChild(widget.container);
if (typeof callbacks?.remount === 'function') {
await callbacks?.remount?.(this._widget, {
shadow: this._shadow,
customElement: this,
});
} else {
widget.root = this._shadow;
widget.customElement = this;
this._shadow.appendChild(widget.container);
}

return;
}
Expand Down

0 comments on commit a4a761a

Please sign in to comment.