diff --git a/frontend/src/ts/utils/dom.ts b/frontend/src/ts/utils/dom.ts index 7c5d808ff..2e063a1d4 100644 --- a/frontend/src/ts/utils/dom.ts +++ b/frontend/src/ts/utils/dom.ts @@ -461,7 +461,7 @@ export class ElementWithUtils { /** * Set value of input or textarea to a string. */ - setValue(this: ElementWithUtils, value: string): this { + setValue(value: string): this { if (this.hasValue()) { this.native.value = value; } @@ -610,6 +610,18 @@ export class ElementsWithUtils< return this; } + /** + * Set value of all inputs or textareas in the array to a string. + */ + + setValue(value: string): this { + for (const item of this) { + item.setValue(value); + } + + return this; + } + /** * Set the disabled attribute on all elements in the array */