Skip to content

Commit

Permalink
Fix setting value to textarea via render.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Mar 25, 2024
1 parent fc89405 commit 197d483
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-cherries-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chialab/dna": patch
---

Fix setting value to textarea via render.
3 changes: 2 additions & 1 deletion src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ const setProperty = <T extends Node | HTMLElement, P extends string & keyof T>(
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;
Expand Down

0 comments on commit 197d483

Please sign in to comment.