From 59c15f714ddcdc4058add0a1b4b1c28a80929fdd Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:07:35 +0200 Subject: [PATCH] Add setValue for ElementsWithUtils --- frontend/src/ts/utils/dom.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 */