diff --git a/package.json b/package.json index 2b62b94..89b2dde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wkit", - "version": "1.10.12", + "version": "1.10.13", "type": "module", "description": "A library for building fast, lightweight web components.", "main": "dist/index.js", diff --git a/src/anim.js b/src/anim.js index 134101f..bd709bf 100644 --- a/src/anim.js +++ b/src/anim.js @@ -5,7 +5,7 @@ */ export function animate(duration = 200, fromto = [], out = false) { - if (out === false) { + if (out === false && this.style.display === 'none') { this.style.display = '' } let res = this.animate(fromto, { diff --git a/src/html.js b/src/html.js index 32cb201..ab13130 100644 --- a/src/html.js +++ b/src/html.js @@ -140,6 +140,7 @@ function getTemplateHtml(strings, type) { } return [htmlResult, attrNames] } + class Template { constructor({ strings, ['__dom_type__']: type }, options) { this.parts = [] @@ -480,7 +481,7 @@ class AttributePart { this.$parent = parent this.options = options if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') { - this._$committedValue = new Array(strings.length - 1).fill(new String()) + this._$committedValue = new Array(strings.length - 1).fill('') this.strings = strings } else { this._$committedValue = NOTHING