yandel 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/node.js +17 -3
  2. package/package.json +1 -1
package/dist/node.js CHANGED
@@ -341,7 +341,8 @@ function _remove_html_prop(dom, props, prop) {
341
341
  }
342
342
  catch (error) { }
343
343
  }
344
- dom.removeAttribute(prop);
344
+ else
345
+ dom.removeAttribute(prop);
345
346
  }
346
347
  function _get_props_diff(a, b) {
347
348
  const _to_remove = {};
@@ -438,6 +439,10 @@ class TagNode extends Node {
438
439
  _clear_props(this._dom, diff.remove);
439
440
  _apply_props(this._dom, diff.apply);
440
441
  this._props = nprops;
442
+ if (this.tag === "input" &&
443
+ !("value" in diff.apply && "value" in diff.remove)) {
444
+ this._dom.value = "";
445
+ }
441
446
  }
442
447
  else {
443
448
  this._props = nprops;
@@ -523,8 +528,17 @@ class TagNode extends Node {
523
528
  _apply_props(this._dom, this._props);
524
529
  }
525
530
  }
526
- else if (t.props)
527
- this._props = t.props;
531
+ else {
532
+ // DOM not created yet
533
+ if (this._props) {
534
+ if (t.props)
535
+ this._diff_dom_props(t.props);
536
+ }
537
+ else {
538
+ this._props = t.props ? t.props : undefined;
539
+ }
540
+ this.create();
541
+ }
528
542
  }
529
543
  else {
530
544
  // Tag has changed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yandel",
3
3
  "description": "A reactive lightweight TS frontend framework",
4
- "version": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [