@ipxjs/refract 0.15.0 → 0.16.0
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/package.json +1 -1
- package/src/refract/dom.ts +8 -0
package/package.json
CHANGED
package/src/refract/dom.ts
CHANGED
|
@@ -164,6 +164,14 @@ export function applyProps(
|
|
|
164
164
|
el.removeEventListener(event, getEventListener(oldProps[key]));
|
|
165
165
|
}
|
|
166
166
|
el.addEventListener(event, getEventListener(newProps[key]));
|
|
167
|
+
} else if (
|
|
168
|
+
!isSvgElement &&
|
|
169
|
+
(key === "value" || key === "checked") &&
|
|
170
|
+
(el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT")
|
|
171
|
+
) {
|
|
172
|
+
// Use DOM property for form element values (like React does), so that
|
|
173
|
+
// controlled inputs update their displayed value correctly.
|
|
174
|
+
(el as any)[key] = newProps[key] ?? (key === "checked" ? false : "");
|
|
167
175
|
} else {
|
|
168
176
|
const value = newProps[key];
|
|
169
177
|
const attr = normalizeAttributeName(key, isSvgElement);
|