From 197d483b2aea467d86bc796677d9a3c801b0ac32 Mon Sep 17 00:00:00 2001 From: Edoardo Cavazza Date: Mon, 25 Mar 2024 10:06:03 +0100 Subject: [PATCH] Fix setting value to textarea via render. --- .changeset/small-cherries-taste.md | 5 +++++ src/render.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/small-cherries-taste.md diff --git a/.changeset/small-cherries-taste.md b/.changeset/small-cherries-taste.md new file mode 100644 index 00000000..89114f36 --- /dev/null +++ b/.changeset/small-cherries-taste.md @@ -0,0 +1,5 @@ +--- +"@chialab/dna": patch +--- + +Fix setting value to textarea via render. diff --git a/src/render.ts b/src/render.ts index 44ead388..c25421ad 100644 --- a/src/render.ts +++ b/src/render.ts @@ -178,7 +178,8 @@ const setProperty = ( constructor?: ComponentConstructor ) => { const isInputValue = - (propertyKey === 'checked' || propertyKey === 'value') && (node as HTMLElement).tagName === 'INPUT'; + (propertyKey === 'checked' || propertyKey === 'value') && + ((node as HTMLElement).tagName === 'INPUT' || (node as HTMLElement).tagName === 'TEXTAREA'); if (oldValue === value && !isInputValue) { return;