@lukekaalim/act-web 5.1.0 → 5.1.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lukekaalim/act-web
2
2
 
3
+ ## 5.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 114c53f: Fix issue with adding/remove ref props from Web elements
8
+
3
9
  ## 5.1.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukekaalim/act-web",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "type": "module",
5
5
  "main": "mod.ts",
6
6
  "exports": {
package/props.ts CHANGED
@@ -41,7 +41,10 @@ export const setSVGElementProps = (
41
41
  }
42
42
  switch (name) {
43
43
  case 'ref':
44
- (next as any).current = node;
44
+ if (prev)
45
+ (prev as any).current = null;
46
+ if (next)
47
+ (next as any).current = node;
45
48
  return true;
46
49
  case 'style':
47
50
  return (setStyleProp(node.style, next as any, prev as any), true);
@@ -72,7 +75,10 @@ export const setHTMLElementProps = (
72
75
  }
73
76
  switch (name) {
74
77
  case 'ref':
75
- (next as any).current = node;
78
+ if (prev)
79
+ (prev as any).current = null;
80
+ if (next)
81
+ (next as any).current = node;
76
82
  return true;
77
83
  case 'style':
78
84
  return (setStyleProp(node.style, next as any, prev as any), true);
package/space.ts CHANGED
@@ -22,7 +22,7 @@ export const createWebNodeBuilder = (
22
22
  switch (tag) {
23
23
  case act.primitiveNodeTypes.string:
24
24
  case act.primitiveNodeTypes.number:
25
- return window.document.createTextNode("<empty text>");
25
+ return window.document.createTextNode((element.props.value as any).toString());
26
26
  default:
27
27
  return null;
28
28
  }