@htmltools/hdom 0.1.4 → 0.1.5

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/lib/hdom.d.ts CHANGED
@@ -163,10 +163,10 @@ export class hdom {
163
163
  */
164
164
  static setFocusTo(e: string | HTMLElement): void;
165
165
  /**
166
- * @param {string|HTMLElement} e
166
+ * @param {string|HTMLElement|RadioNodeList} e
167
167
  * @param {string|number} value
168
168
  */
169
- static setFormElementValue(e: string | HTMLElement, value: string | number): void;
169
+ static setFormElementValue(e: string | HTMLElement | RadioNodeList, value: string | number): void;
170
170
  /**
171
171
  * @param {string|Element} e
172
172
  * @param {string} text
package/lib/hdom.js CHANGED
@@ -355,15 +355,16 @@ export class hdom {
355
355
  }
356
356
 
357
357
  /**
358
- * @param {string|HTMLElement} e
358
+ * @param {string|HTMLElement|RadioNodeList} e
359
359
  * @param {string|number} value
360
360
  */
361
361
  static setFormElementValue(e, value) {
362
- const elem = this.getElement(e);
362
+ const elem = typeof e === "string" ? this.getElement(e) : e;
363
363
  if (
364
364
  elem instanceof HTMLInputElement ||
365
365
  elem instanceof HTMLTextAreaElement ||
366
- elem instanceof HTMLSelectElement
366
+ elem instanceof HTMLSelectElement ||
367
+ elem instanceof RadioNodeList
367
368
  ) {
368
369
  elem.value = value.toString();
369
370
  } else if (elem instanceof HTMLElement) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmltools/hdom",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Tools to interact with the HTML DOM.",
5
5
  "license": "MIT",
6
6
  "repository": {