Skip to content

Commit

Permalink
πŸ› Don't render manually created custom element twice
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Mar 12, 2024
1 parent 5894ba1 commit f44c724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Fix setting `value` property on a `<select>` item not changing the selected option
* Make the `each` expression handle `Map`-like instances correctly
* Fix `each` expression not supporting function calls
* Don't render manually created custom element on initial attachment to the DOM if it has already been manually rendered

## 2.3.18 (2024-02-25)

Expand Down
4 changes: 2 additions & 2 deletions lib/element/custom_element.js
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ Element.setMethod(function updateRenderedTime() {
*
* @author Jelle De Loecker <[email protected]>
* @since 1.1.2
* @version 2.3.15
* @version 2.3.19
*/
Element.setMethod(function connectedCallback() {

Expand Down Expand Up @@ -2082,7 +2082,7 @@ Element.setMethod(function connectedCallback() {
that.emit('rendered', {bubbles: false});
}

if (has_template && that[Hawkejs.CREATED_MANUALLY] && that[Hawkejs.RENDER_CONTENT]) {
if (has_template && that[Hawkejs.CREATED_MANUALLY] && that[Hawkejs.RENDER_CONTENT] && !that.has_rendered) {

let rendering = that[Hawkejs.RENDER_CONTENT]();

Expand Down

0 comments on commit f44c724

Please sign in to comment.